|
@@ -11,6 +11,7 @@ namespace App\Http\Logic\Bside\CustomModule; |
|
@@ -11,6 +11,7 @@ namespace App\Http\Logic\Bside\CustomModule; |
|
11
|
|
11
|
|
|
12
|
use App\Http\Logic\Bside\BaseLogic;
|
12
|
use App\Http\Logic\Bside\BaseLogic;
|
|
13
|
use App\Models\CustomModule\CustomModuleCategory;
|
13
|
use App\Models\CustomModule\CustomModuleCategory;
|
|
|
|
14
|
+use App\Models\RouteMap\RouteMap;
|
|
14
|
|
15
|
|
|
15
|
class CustomModuleCategoryLogic extends BaseLogic
|
16
|
class CustomModuleCategoryLogic extends BaseLogic
|
|
16
|
{
|
17
|
{
|
|
@@ -29,7 +30,11 @@ class CustomModuleCategoryLogic extends BaseLogic |
|
@@ -29,7 +30,11 @@ class CustomModuleCategoryLogic extends BaseLogic |
|
29
|
* @time :2023/12/4 16:10
|
30
|
* @time :2023/12/4 16:10
|
|
30
|
*/
|
31
|
*/
|
|
31
|
public function getCustomModuleCategoryInfo(){
|
32
|
public function getCustomModuleCategoryInfo(){
|
|
32
|
-
|
33
|
+ $info = $this->model->read($this->param);
|
|
|
|
34
|
+ if($info === false){
|
|
|
|
35
|
+ $this->fail('当前数据不存在或已被删除');
|
|
|
|
36
|
+ }
|
|
|
|
37
|
+ return $this->success($info);
|
|
33
|
}
|
38
|
}
|
|
34
|
|
39
|
|
|
35
|
/**
|
40
|
/**
|
|
@@ -40,7 +45,47 @@ class CustomModuleCategoryLogic extends BaseLogic |
|
@@ -40,7 +45,47 @@ class CustomModuleCategoryLogic extends BaseLogic |
|
40
|
* @time :2023/12/4 15:47
|
45
|
* @time :2023/12/4 15:47
|
|
41
|
*/
|
46
|
*/
|
|
42
|
public function customModuleCategorySave(){
|
47
|
public function customModuleCategorySave(){
|
|
|
|
48
|
+ if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
49
|
+ $this->categoryEdit();
|
|
|
|
50
|
+ }else{
|
|
|
|
51
|
+ $this->categoryAdd();
|
|
|
|
52
|
+ }
|
|
|
|
53
|
+ return $this->success();
|
|
|
|
54
|
+ }
|
|
|
|
55
|
+
|
|
|
|
56
|
+ /**
|
|
|
|
57
|
+ * @remark :添加分类
|
|
|
|
58
|
+ * @name :categoryAdd
|
|
|
|
59
|
+ * @author :lyh
|
|
|
|
60
|
+ * @method :post
|
|
|
|
61
|
+ * @time :2023/12/5 10:55
|
|
|
|
62
|
+ */
|
|
|
|
63
|
+ public function categoryAdd(){
|
|
|
|
64
|
+ try {
|
|
|
|
65
|
+ $id = $this->model->addReturnId($this->param);
|
|
|
|
66
|
+ $route = RouteMap::setRoute($this->param['route'], 'module-'.$this->param['module_id'], $id, $this->user['project_id']);
|
|
|
|
67
|
+ $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route);
|
|
|
|
68
|
+ $this->edit(['url' => $route], ['id' => $id]);
|
|
|
|
69
|
+ }catch (\Exception $e){
|
|
|
|
70
|
+ $this->fail('系统错误,请联系管理员');
|
|
|
|
71
|
+ }
|
|
43
|
|
72
|
|
|
|
|
73
|
+ return $this->success();
|
|
|
|
74
|
+ }
|
|
|
|
75
|
+
|
|
|
|
76
|
+ /**
|
|
|
|
77
|
+ * @remark :编辑分类
|
|
|
|
78
|
+ * @name :categoryEdit
|
|
|
|
79
|
+ * @author :lyh
|
|
|
|
80
|
+ * @method :post
|
|
|
|
81
|
+ * @time :2023/12/5 10:55
|
|
|
|
82
|
+ */
|
|
|
|
83
|
+ public function categoryEdit(){
|
|
|
|
84
|
+ $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
85
|
+ if($rs === false){
|
|
|
|
86
|
+ $this->fail('系统错误,请连续管理员');
|
|
|
|
87
|
+ }
|
|
|
|
88
|
+ return $this->success();
|
|
44
|
}
|
89
|
}
|
|
45
|
|
90
|
|
|
46
|
/**
|
91
|
/**
|
|
@@ -51,6 +96,10 @@ class CustomModuleCategoryLogic extends BaseLogic |
|
@@ -51,6 +96,10 @@ class CustomModuleCategoryLogic extends BaseLogic |
|
51
|
* @time :2023/12/4 15:47
|
96
|
* @time :2023/12/4 15:47
|
|
52
|
*/
|
97
|
*/
|
|
53
|
public function customModuleCategoryDel(){
|
98
|
public function customModuleCategoryDel(){
|
|
54
|
-
|
99
|
+ $rs = $this->model->del($this->param);
|
|
|
|
100
|
+ if($rs === false){
|
|
|
|
101
|
+ $this->fail('系统错误,请连续管理员');
|
|
|
|
102
|
+ }
|
|
|
|
103
|
+ return $this->success();
|
|
55
|
}
|
104
|
}
|
|
56
|
} |
105
|
} |