where(['status' => 0])->select(); $service = new PromoteService(); foreach ($list as $task) { if ($task['type'] == 1) { $result = $this->shiftPromote($task); } elseif ($task['type'] == 2) { $result = $this->shiftPlayer($task); } } } }