任务安排-添加任务时选择任务创建模板,自动填充表单

This commit is contained in:
chenbo 2023-12-18 17:22:01 +08:00
parent 3b856cd25c
commit 1fc6696e70
2 changed files with 5 additions and 2 deletions

View File

@ -115,7 +115,9 @@ class CreateTaskTemplateController extends BaseAdminController
public function selectList()
{
$list = CreateTaskTemplateLogic::getList();
$role = $this->request->param('task_role_id');
$list = CreateTaskTemplateLogic::getList($role);
return $this->data($list);
}

View File

@ -165,10 +165,11 @@ class CreateTaskTemplateLogic extends BaseLogic
}
}
public static function getList()
public static function getList($role)
{
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'])
->whereIn('task_role_id', explode(',', $role))
->select()
->toArray();
}