['payment_type', 'apply_date'], '%like%' => ['payment_code'], ]; } /** * @notes 获取工资付款列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/12/27 16:08 */ public function lists(): array { return ProjectSalaryPayment::where($this->searchWhere) ->field(['id', 'payment_code', 'project_id', 'payment_type', 'apply_date', 'total_amount', 'total_amount_uppercase', 'remark', 'annex']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($item){ $project = Project::field('name,project_code')->where('id',$item['project_id'])->findOrEmpty(); $item['project_name'] = $project['name']; $item['project_code'] = $project['project_code']; return $item; }) ->toArray(); } /** * @notes 获取工资付款数量 * @return int * @author likeadmin * @date 2023/12/27 16:08 */ public function count(): int { return ProjectSalaryPayment::where($this->searchWhere)->count(); } }