diff --git a/app/adminapi/controller/CreateTaskTemplateController.php b/app/adminapi/controller/create_task_template/CreateTaskTemplateController.php similarity index 85% rename from app/adminapi/controller/CreateTaskTemplateController.php rename to app/adminapi/controller/create_task_template/CreateTaskTemplateController.php index 46bfe2d68..a8f07eca0 100644 --- a/app/adminapi/controller/CreateTaskTemplateController.php +++ b/app/adminapi/controller/create_task_template/CreateTaskTemplateController.php @@ -13,19 +13,19 @@ // +---------------------------------------------------------------------- -namespace app\adminapi\controller; +namespace app\adminapi\controller\create_task_template; use app\adminapi\controller\BaseAdminController; -use app\adminapi\lists\CreateTaskTemplateLists; -use app\adminapi\logic\CreateTaskTemplateLogic; -use app\adminapi\validate\CreateTaskTemplateValidate; +use app\adminapi\lists\create_task_template\CreateTaskTemplateLists; +use app\adminapi\logic\create_task_template\CreateTaskTemplateLogic; +use app\adminapi\validate\create_task_template\CreateTaskTemplateValidate; /** * CreateTaskTemplate控制器 * Class CreateTaskTemplateController - * @package app\adminapi\controller + * @package app\adminapi\controller\create_task_template */ class CreateTaskTemplateController extends BaseAdminController { @@ -35,7 +35,7 @@ class CreateTaskTemplateController extends BaseAdminController * @notes 获取列表 * @return \think\response\Json * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function lists() { @@ -47,7 +47,7 @@ class CreateTaskTemplateController extends BaseAdminController * @notes 添加 * @return \think\response\Json * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function add() { @@ -64,7 +64,7 @@ class CreateTaskTemplateController extends BaseAdminController * @notes 编辑 * @return \think\response\Json * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function edit() { @@ -81,7 +81,7 @@ class CreateTaskTemplateController extends BaseAdminController * @notes 删除 * @return \think\response\Json * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function delete() { @@ -95,7 +95,7 @@ class CreateTaskTemplateController extends BaseAdminController * @notes 获取详情 * @return \think\response\Json * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function detail() { diff --git a/app/adminapi/lists/CreateTaskTemplateLists.php b/app/adminapi/lists/create_task_template/CreateTaskTemplateLists.php similarity index 82% rename from app/adminapi/lists/CreateTaskTemplateLists.php rename to app/adminapi/lists/create_task_template/CreateTaskTemplateLists.php index 42390c218..8acb2eb2b 100644 --- a/app/adminapi/lists/CreateTaskTemplateLists.php +++ b/app/adminapi/lists/create_task_template/CreateTaskTemplateLists.php @@ -12,18 +12,18 @@ // | author: likeadminTeam // +---------------------------------------------------------------------- -namespace app\adminapi\lists; +namespace app\adminapi\lists\create_task_template; use app\adminapi\lists\BaseAdminDataLists; -use app\common\model\CreateTaskTemplate; +use app\common\model\create_task_template\CreateTaskTemplate; use app\common\lists\ListsSearchInterface; /** * CreateTaskTemplate列表 * Class CreateTaskTemplateLists - * @package app\adminapi\lists + * @package app\adminapi\listscreate_task_template */ class CreateTaskTemplateLists extends BaseAdminDataLists implements ListsSearchInterface { @@ -33,12 +33,12 @@ class CreateTaskTemplateLists extends BaseAdminDataLists implements ListsSearchI * @notes 设置搜索条件 * @return \string[][] * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function setSearch(): array { return [ - '=' => ['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'], + '=' => ['title', 'task_role_id', 'type'], ]; } @@ -50,12 +50,12 @@ class CreateTaskTemplateLists extends BaseAdminDataLists implements ListsSearchI * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function lists(): array { return CreateTaskTemplate::where($this->searchWhere) - ->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', 'delete_time']) + ->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']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() @@ -67,7 +67,7 @@ class CreateTaskTemplateLists extends BaseAdminDataLists implements ListsSearchI * @notes 获取数量 * @return int * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function count(): int { diff --git a/app/adminapi/logic/CreateTaskTemplateLogic.php b/app/adminapi/logic/create_task_template/CreateTaskTemplateLogic.php similarity index 91% rename from app/adminapi/logic/CreateTaskTemplateLogic.php rename to app/adminapi/logic/create_task_template/CreateTaskTemplateLogic.php index 4926afdbe..0d2f9a8fb 100644 --- a/app/adminapi/logic/CreateTaskTemplateLogic.php +++ b/app/adminapi/logic/create_task_template/CreateTaskTemplateLogic.php @@ -12,10 +12,10 @@ // | author: likeadminTeam // +---------------------------------------------------------------------- -namespace app\adminapi\logic; +namespace app\adminapi\logic\create_task_template; -use app\common\model\CreateTaskTemplate; +use app\common\model\create_task_template\CreateTaskTemplate; use app\common\logic\BaseLogic; use think\facade\Db; @@ -23,7 +23,7 @@ use think\facade\Db; /** * CreateTaskTemplate逻辑 * Class CreateTaskTemplateLogic - * @package app\adminapi\logic + * @package app\adminapi\logic\create_task_template */ class CreateTaskTemplateLogic extends BaseLogic { @@ -34,7 +34,7 @@ class CreateTaskTemplateLogic extends BaseLogic * @param array $params * @return bool * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public static function add(array $params): bool { @@ -42,6 +42,7 @@ class CreateTaskTemplateLogic extends BaseLogic try { CreateTaskTemplate::create([ 'title' => $params['title'], + 'admin_id' => $params['admin_id'], 'task_role_id' => $params['task_role_id'], 'type' => $params['type'], 'stage_day_one' => $params['stage_day_one'], @@ -74,7 +75,7 @@ class CreateTaskTemplateLogic extends BaseLogic * @param array $params * @return bool * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public static function edit(array $params): bool { @@ -82,6 +83,7 @@ class CreateTaskTemplateLogic extends BaseLogic try { CreateTaskTemplate::where('id', $params['id'])->update([ 'title' => $params['title'], + 'admin_id' => $params['admin_id'], 'task_role_id' => $params['task_role_id'], 'type' => $params['type'], 'stage_day_one' => $params['stage_day_one'], @@ -114,7 +116,7 @@ class CreateTaskTemplateLogic extends BaseLogic * @param array $params * @return bool * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public static function delete(array $params): bool { @@ -127,7 +129,7 @@ class CreateTaskTemplateLogic extends BaseLogic * @param $params * @return array * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public static function detail($params): array { diff --git a/app/adminapi/validate/CreateTaskTemplateValidate.php b/app/adminapi/validate/create_task_template/CreateTaskTemplateValidate.php similarity index 89% rename from app/adminapi/validate/CreateTaskTemplateValidate.php rename to app/adminapi/validate/create_task_template/CreateTaskTemplateValidate.php index ded4b1a36..9e61076e0 100644 --- a/app/adminapi/validate/CreateTaskTemplateValidate.php +++ b/app/adminapi/validate/create_task_template/CreateTaskTemplateValidate.php @@ -12,7 +12,7 @@ // | author: likeadminTeam // +---------------------------------------------------------------------- -namespace app\adminapi\validate; +namespace app\adminapi\validate\create_task_template; use app\common\validate\BaseValidate; @@ -21,7 +21,7 @@ use app\common\validate\BaseValidate; /** * CreateTaskTemplate验证器 * Class CreateTaskTemplateValidate - * @package app\adminapi\validate + * @package app\adminapi\validate\create_task_template */ class CreateTaskTemplateValidate extends BaseValidate { @@ -48,7 +48,7 @@ class CreateTaskTemplateValidate extends BaseValidate * @notes 添加场景 * @return CreateTaskTemplateValidate * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function sceneAdd() { @@ -60,7 +60,7 @@ class CreateTaskTemplateValidate extends BaseValidate * @notes 编辑场景 * @return CreateTaskTemplateValidate * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function sceneEdit() { @@ -72,7 +72,7 @@ class CreateTaskTemplateValidate extends BaseValidate * @notes 删除场景 * @return CreateTaskTemplateValidate * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function sceneDelete() { @@ -84,7 +84,7 @@ class CreateTaskTemplateValidate extends BaseValidate * @notes 详情场景 * @return CreateTaskTemplateValidate * @author likeadmin - * @date 2023/12/18 14:06 + * @date 2023/12/18 14:50 */ public function sceneDetail() { diff --git a/app/common/model/CreateTaskTemplate.php b/app/common/model/create_task_template/CreateTaskTemplate.php similarity index 83% rename from app/common/model/CreateTaskTemplate.php rename to app/common/model/create_task_template/CreateTaskTemplate.php index e64fd5325..c8772af31 100644 --- a/app/common/model/CreateTaskTemplate.php +++ b/app/common/model/create_task_template/CreateTaskTemplate.php @@ -12,23 +12,23 @@ // | author: likeadminTeam // +---------------------------------------------------------------------- -namespace app\common\model; +namespace app\common\model\create_task_template; use app\common\model\BaseModel; - +use think\model\concern\SoftDelete; /** * CreateTaskTemplate模型 * Class CreateTaskTemplate - * @package app\common\model + * @package app\common\model\create_task_template */ class CreateTaskTemplate extends BaseModel { - + use SoftDelete; protected $name = 'create_task_template'; - + protected $deleteTime = 'delete_time'; } \ No newline at end of file