model = new ServiceLogs(); } /** * 获取学员课时消费记录列表 * @return array */ public function getPage(array $data = []) { $where = []; if($data['name']){ $where[] = ['b.name','like','%'.$data['name'].'%']; } if($data['score']){ $where[] = ['a.score','=',$data['score']]; } $search_model = $this->model ->alias("a") ->join(['school_customer_resources' => 'b'],'a.resource_id = b.id','left') ->join(['school_personnel' => 'c'],'a.staff_id = c.id','left') ->join(['school_service' => 'd'],'a.service_id = d.id','left') ->where($where) ->field("a.*,b.name,c.name as staff_name,d.service_name,d.customer_confirmation") ->order("a.id desc"); $list = $this->pageQuery($search_model); return $list; } }