//tp5$lable_id=$this->request->post('lable_id','','trim,strip_tags');if($lable_id){$where['intention_label']=['like','%'.$lable_id.'%'];}$font_person=$this->request->post('font_person','','trim,strip_tags');if($font_person){$array=json_decode($font_person,true);if($array){$where['front_charge']=['in',$array];}}//find in setif(!in_array(1,$this->user->role)){$id=$this->user->id;$where[]=['exp',Db::raw("FIND_IN_SET(".$id.",b_customer_id)")];//b_customer_id为数据库字段名例:1,2,3,4}
//tp6$like=[];$cate_id=[];if(isset($param['keyworld'])){$like=[['title','like','%'.$param['keyworld'].'%']];}if(isset($param['cate_id'])&&$param['cate_id']!=''){$cate_id=[['cate_id','in',explode(',',$param['cate_id'])]];//分类id}//多个字段模糊查询$model=newNews();if(isset($param['keywords_'])&&$param['keywords_']!=''){$model=$model->where('title|descs|content','like','%'.$param['keywords_'].'%');}$data=$model->order('sort desc,id desc')->select();//between$where=[];$start=strtotime(date("Y-m-d H:i:s",strtotime($param['start_time'])));$end=strtotime(date("Y-m-d H:i:s",strtotime($param['end_time'])+86399));$where[]=['create_time','between',"{$start},{$end}"];//find in setif(!in_array(1,$this->user->role)){$id=$this->user->id;$where[]=['','exp',Db::raw("FIND_IN_SET($id,head)")];//head为数据库字段名例:1,2,3,4}