['title','mobile'], '=' => ['type'] ]; } /** * @notes 自定查询条件 * @return array * @author 段誉 * @date 2022/10/25 16:53 */ public function queryWhere() { $where = []; if (isset($this->params['status']) && $this->params['status']) { $status = $this->params['status']; $where[] = ['status', '=',$status]; } return $where; } /** * @notes 设置支持排序字段 * @return array * @author heshihu * @date 2022/2/9 15:11 */ public function setSortFields(): array { return [ 'id' => 'id']; } /** * @notes 设置默认排序 * @return array * @author heshihu * @date 2022/2/9 15:08 */ public function setDefaultOrder(): array { return ['id' => 'desc']; } /** * @notes 获取管理列表 * @return array * @author heshihu * @date 2022/2/21 17:11 */ public function lists(): array { $supplyDemandLists = SupplyDemandInfo::where($this->searchWhere) ->where($this->queryWhere()) ->limit($this->limitOffset, $this->limitLength) ->order($this->sortOrder) ->append(['status_desc','type_desc','user']) ->select() ->toArray(); return $supplyDemandLists; } /** * @notes 获取数量 * @return int * @author heshihu * @date 2022/2/9 15:12 */ public function count(): int { return SupplyDemandInfo::where($this->searchWhere)->where($this->queryWhere())->count(); } public function extend() { return []; } }