diff --git a/app/adminapi/controller/task_scheduling_plan/TaskSchedulingPlanController.php b/app/adminapi/controller/task_scheduling_plan/TaskSchedulingPlanController.php index 81bf41b27..3e4efb6a4 100644 --- a/app/adminapi/controller/task_scheduling_plan/TaskSchedulingPlanController.php +++ b/app/adminapi/controller/task_scheduling_plan/TaskSchedulingPlanController.php @@ -120,13 +120,13 @@ class TaskSchedulingPlanController extends BaseAdminController { $companyId = $this->request->param('company_id', 0); $date = $this->request->param('date',); - $list = TaskSchedulingPlan::where(['company_id' => $companyId]) + $lists = TaskSchedulingPlan::where(['company_id' => $companyId]) ->where('start_time', strtotime($date)) ->with(['template','templateInfo', 'task']) ->order(['id' => 'desc']) ->select() ->toArray(); - return $this->success('', $list); + return $this->success('', compact('lists')); } diff --git a/app/common/model/task_scheduling_plan/TaskSchedulingPlan.php b/app/common/model/task_scheduling_plan/TaskSchedulingPlan.php index e2a4ccefe..246414467 100644 --- a/app/common/model/task_scheduling_plan/TaskSchedulingPlan.php +++ b/app/common/model/task_scheduling_plan/TaskSchedulingPlan.php @@ -49,7 +49,7 @@ class TaskSchedulingPlan extends BaseModel } public function task() { - return $this->hasOne(Task::class, 'task_id', 'id'); + return $this->hasOne(Task::class, 'id', 'task_id'); } public function templateInfo() {