$keyword['pr_gh_type']]; } if ($keyword['phone'] != ''){ $mapPhone = [['phone','like','%'.$keyword['phone'].'%']]; } if ($keyword['kh_name'] != ''){ $mapKhName = [['kh_name','like','%'.$keyword['kh_name'].'%']]; } $result = Db::table('crm_leads') ->where($mapPhone) ->where($mapKhName) ->where($mapXsSource) ->where($mapAtTime) ->where(['status'=>2]) //0-线索,1-客户,2-公海 ->whereTime('to_gh_time',$keyword['timebucket'] ? $keyword['timebucket'] : null) ->order('to_gh_time desc') ->paginate(array('list_rows'=>$limit,'page'=>$page)) ->toArray(); //数据集判断方式 //if($result->isEmpty()){return null;} if($result['total'] == 0){ return null; }else{ return $result; } } }