params['user_id']) && !empty($this->params['user_id'])){ $this->params['master_worker_id'] = $this->params['user_id']; } return [ '=' => ['work_sn','master_worker_id'], ]; } /* * 查询条件 * @return array * @author liuguanci * @date 2024/7/11 下午1:46 */ public function queryWhere(){ $where = []; if(isset($this->params['spare_name']) && !empty($this->params['spare_name'])){ $where[] = ['spare_name','like','%'.$this->params['spare_name'].'%']; } return $where; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/09/14 15:08 */ public function lists(): array { // 配件信息 $id = ServiceWork::where($this->searchWhere)->value('id'); $spare_parts = []; if($id){ $spare_parts = ServiceWorkSpare::getLists($id); } return $spare_parts?array_values($spare_parts):[]; } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2024/09/14 15:08 */ public function count(): int { return $this->count; } }