From 5f3e46b4a21ff153320fb7bc10a64e773bd55d36 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Mon, 18 Dec 2023 15:33:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=AE=89=E6=8E=92-=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BB=BB=E5=8A=A1=E6=97=B6=E9=80=89=E6=8B=A9=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=88=9B=E5=BB=BA=E6=A8=A1=E6=9D=BF=EF=BC=8C=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=A1=AB=E5=85=85=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateTaskTemplateController.php | 12 +++++++ .../CreateTaskTemplateLogic.php | 32 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/app/adminapi/controller/create_task_template/CreateTaskTemplateController.php b/app/adminapi/controller/create_task_template/CreateTaskTemplateController.php index a8f07eca0..d3c969147 100644 --- a/app/adminapi/controller/create_task_template/CreateTaskTemplateController.php +++ b/app/adminapi/controller/create_task_template/CreateTaskTemplateController.php @@ -104,5 +104,17 @@ class CreateTaskTemplateController extends BaseAdminController return $this->data($result); } + public function taskTypeList() + { + $taskRoleId = $this->request->param('task_role_id'); + $result = CreateTaskTemplateLogic::taskTypeList($taskRoleId); + return $this->data($result); + } + + public function selectList() + { + $list = CreateTaskTemplateLogic::getList(); + return $this->data($list); + } } \ No newline at end of file diff --git a/app/adminapi/logic/create_task_template/CreateTaskTemplateLogic.php b/app/adminapi/logic/create_task_template/CreateTaskTemplateLogic.php index 0d2f9a8fb..f495989cc 100644 --- a/app/adminapi/logic/create_task_template/CreateTaskTemplateLogic.php +++ b/app/adminapi/logic/create_task_template/CreateTaskTemplateLogic.php @@ -15,6 +15,7 @@ namespace app\adminapi\logic\create_task_template; +use app\adminapi\logic\ConfigLogic; use app\common\model\create_task_template\CreateTaskTemplate; use app\common\logic\BaseLogic; use think\facade\Db; @@ -135,4 +136,35 @@ class CreateTaskTemplateLogic extends BaseLogic { return CreateTaskTemplate::findOrEmpty($params['id'])->toArray(); } + + public static function taskTypeList($taskRoleId=0) + { + $type = ''; + switch ($taskRoleId) { + case 1: + $type = 'town_task_type_master'; + case 2: + $type = 'town_task_type_marketing_director'; + case 3: + $type = 'town_task_type'; + case 4: + $type = 'village_task_type'; + case 5: + $type = 'task_type'; + } + if ($type) { + $data = ConfigLogic::getDictByType($type); + return $data; + } else { + return []; + } + } + + public static function getList() + { + return CreateTaskTemplate::field(['id', 'title', 'admin_id', 'task_role_id', 'type', 'stage_day_one', 'money', 'proportion_one', 'stage_day_two', 'proportion_two', 'money_two', 'stage_day_three', 'new_money_three', 'money_longtime', 'types', 'extend', 'recharge', 'content']) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } } \ No newline at end of file