['company_id', 'content'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/09/23 15:14 */ public function lists(): array { return CompanyComplaintFeedback::where($this->searchWhere) ->field(['id', 'company_id', 'content']) ->append(['company_name'], true) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->withAttr('company_name', function ($value, $data) { $company = Company::where('id', $data['company_id'])->find(); return $company['company_name']; }) ->select() ->toArray(); } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2023/09/23 15:14 */ public function count(): int { return CompanyComplaintFeedback::where($this->searchWhere)->count(); } }