['diagnosis_id', 'status', 'creator_id'], ]; } public function lists(): array { $lists = DiagnosisTodo::where($this->searchWhere) ->field([ 'id', 'diagnosis_id', 'patient_id', 'content', 'remind_time', 'status', 'creator_id', 'creator_name', 'notified_at', 'error', 'cancelled_at', 'cancelled_by', 'create_time', 'update_time', ]) ->append([ 'status_text', 'remind_time_text', 'notified_at_text', 'cancelled_at_text', ]) ->order('remind_time', 'desc') ->order('id', 'desc') ->limit($this->limitOffset, $this->limitLength) ->select() ->toArray(); // 业务态:是否能被「我」取消(前端按钮显隐用) $adminId = (int) $this->adminId; foreach ($lists as &$item) { $item['can_cancel'] = DiagnosisTodoLogic::canCancel($item, $adminId); } return $lists; } public function count(): int { return DiagnosisTodo::where($this->searchWhere)->count(); } }