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‘);
原文地址:https://www.cnblogs.com/starfish29/p/11000179.html
时间: 2024-10-07 10:17:33