|
...
|
...
|
@@ -11,6 +11,7 @@ namespace App\Http\Logic\Bside\CustomModule; |
|
|
|
|
|
|
|
use App\Http\Logic\Bside\BaseLogic;
|
|
|
|
use App\Models\CustomModule\CustomModuleCategory;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
|
|
|
|
class CustomModuleCategoryLogic extends BaseLogic
|
|
|
|
{
|
|
...
|
...
|
@@ -29,7 +30,11 @@ class CustomModuleCategoryLogic extends BaseLogic |
|
|
|
* @time :2023/12/4 16:10
|
|
|
|
*/
|
|
|
|
public function getCustomModuleCategoryInfo(){
|
|
|
|
|
|
|
|
$info = $this->model->read($this->param);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('当前数据不存在或已被删除');
|
|
|
|
}
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -40,7 +45,47 @@ class CustomModuleCategoryLogic extends BaseLogic |
|
|
|
* @time :2023/12/4 15:47
|
|
|
|
*/
|
|
|
|
public function customModuleCategorySave(){
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$this->categoryEdit();
|
|
|
|
}else{
|
|
|
|
$this->categoryAdd();
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :添加分类
|
|
|
|
* @name :categoryAdd
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/12/5 10:55
|
|
|
|
*/
|
|
|
|
public function categoryAdd(){
|
|
|
|
try {
|
|
|
|
$id = $this->model->addReturnId($this->param);
|
|
|
|
$route = RouteMap::setRoute($this->param['route'], 'module-'.$this->param['module_id'], $id, $this->user['project_id']);
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route);
|
|
|
|
$this->edit(['url' => $route], ['id' => $id]);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :编辑分类
|
|
|
|
* @name :categoryEdit
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/12/5 10:55
|
|
|
|
*/
|
|
|
|
public function categoryEdit(){
|
|
|
|
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
if($rs === false){
|
|
|
|
$this->fail('系统错误,请连续管理员');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -51,6 +96,10 @@ class CustomModuleCategoryLogic extends BaseLogic |
|
|
|
* @time :2023/12/4 15:47
|
|
|
|
*/
|
|
|
|
public function customModuleCategoryDel(){
|
|
|
|
|
|
|
|
$rs = $this->model->del($this->param);
|
|
|
|
if($rs === false){
|
|
|
|
$this->fail('系统错误,请连续管理员');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|