TP5.1 遇见问题整理
1. 获取当前执行sql
fetchSql(true)
self::table('ecm_draw_address')->field('id')->where(array('store_id'=>$data['store_id']))->fetchSql(true)->find();
2. 多where条件
where("字段名","表达式",“查询条件”)
$where = [ ['activity_id', 'eq', $this->data['activity_id']], ['phone', 'neq', ""], ]; $award_info = DrawAwardModel::getList($where,'id','100','0','award_level asc');