正在显示
2 个修改的文件
包含
6 行增加
和
1 行删除
| @@ -66,7 +66,7 @@ class ExtensionModuleController extends BaseController | @@ -66,7 +66,7 @@ class ExtensionModuleController extends BaseController | ||
| 66 | 'module_id.required' => '模块id不能为空', | 66 | 'module_id.required' => '模块id不能为空', |
| 67 | ]); | 67 | ]); |
| 68 | $moduleFieldModel = new ExtensionModuleField(); | 68 | $moduleFieldModel = new ExtensionModuleField(); |
| 69 | - $list = $moduleFieldModel->list(['module_id'=>$this->param['module_id']]); | 69 | + $list = $moduleFieldModel->list(['module_id'=>$this->param['module_id']],'sort'); |
| 70 | $moduleValueModel = new ExtensionModuleValue(); | 70 | $moduleValueModel = new ExtensionModuleValue(); |
| 71 | foreach ($list as $k => $v){ | 71 | foreach ($list as $k => $v){ |
| 72 | $v['is_use'] = 0; | 72 | $v['is_use'] = 0; |
| @@ -149,6 +149,11 @@ class CustomModuleContentLogic extends BaseLogic | @@ -149,6 +149,11 @@ class CustomModuleContentLogic extends BaseLogic | ||
| 149 | * @time :2023/12/7 15:04 | 149 | * @time :2023/12/7 15:04 |
| 150 | */ | 150 | */ |
| 151 | public function contentAdd(){ | 151 | public function contentAdd(){ |
| 152 | + //验证当前name是否已添加 | ||
| 153 | + $info = $this->model->read(['name'=>$this->param['name'],'module_id'=>$this->param['module_id']]); | ||
| 154 | + if($info !== false){ | ||
| 155 | + $this->fail('当前数据名称已存在'); | ||
| 156 | + } | ||
| 152 | try { | 157 | try { |
| 153 | $this->param['sort'] = $this->setNewsSort(); | 158 | $this->param['sort'] = $this->setNewsSort(); |
| 154 | $id = $this->model->addReturnId($this->param); | 159 | $id = $this->model->addReturnId($this->param); |
-
请 注册 或 登录 后发表评论