taskRepository = $taskRepository; } //获取任务类型 public function getTask($utype, $type = '') { $lists = Cache::get('task_list'); if ($lists === null) { $task_lists = $this->taskRepository->all(); foreach ($task_lists as $k => $v) { $lists[$v->utype][$v->t_alias] = $v; } Cache::put('task_list', $lists, '86400'); } if ($type) { return array_get($lists[$utype], $type); } return $lists[$utype]; } }