|
@@ -99,6 +99,7 @@ class CategoryLogic extends BaseLogic |
|
@@ -99,6 +99,7 @@ class CategoryLogic extends BaseLogic |
|
99
|
$info = $this->model->read(['id'=>$id]);
|
99
|
$info = $this->model->read(['id'=>$id]);
|
|
100
|
$info['url'] = $info['route'];
|
100
|
$info['url'] = $info['route'];
|
|
101
|
$info['image_link'] = getImageUrl($info['image']);
|
101
|
$info['image_link'] = getImageUrl($info['image']);
|
|
|
|
102
|
+ $info['describe_image'] = getImageUrl($info['describe_image']);
|
|
102
|
return $this->success($info);
|
103
|
return $this->success($info);
|
|
103
|
}
|
104
|
}
|
|
104
|
|
105
|
|
|
@@ -112,12 +113,12 @@ class CategoryLogic extends BaseLogic |
|
@@ -112,12 +113,12 @@ class CategoryLogic extends BaseLogic |
|
112
|
public function categorySave(){
|
113
|
public function categorySave(){
|
|
113
|
DB::beginTransaction();
|
114
|
DB::beginTransaction();
|
|
114
|
try {
|
115
|
try {
|
|
|
|
116
|
+ $this->param = $this->saveHandleParam($this->param);
|
|
115
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
117
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
116
|
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $this->param['id'], $this->user['project_id']);
|
118
|
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $this->param['id'], $this->user['project_id']);
|
|
117
|
$route = $this->param['route'];
|
119
|
$route = $this->param['route'];
|
|
118
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
120
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
119
|
}else{
|
121
|
}else{
|
|
120
|
- $this->param['project_id'] = $this->user['project_id'];
|
|
|
|
121
|
$id = $this->model->addReturnId($this->param);
|
122
|
$id = $this->model->addReturnId($this->param);
|
|
122
|
$route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $id, $this->user['project_id']);
|
123
|
$route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $id, $this->user['project_id']);
|
|
123
|
$this->edit(['route'=>$route],['id'=>$id]);
|
124
|
$this->edit(['route'=>$route],['id'=>$id]);
|
|
@@ -135,6 +136,25 @@ class CategoryLogic extends BaseLogic |
|
@@ -135,6 +136,25 @@ class CategoryLogic extends BaseLogic |
|
135
|
}
|
136
|
}
|
|
136
|
|
137
|
|
|
137
|
/**
|
138
|
/**
|
|
|
|
139
|
+ * @remark :保存时处理数据
|
|
|
|
140
|
+ * @name :saveHandleParam
|
|
|
|
141
|
+ * @author :lyh
|
|
|
|
142
|
+ * @method :post
|
|
|
|
143
|
+ * @time :2023/12/22 17:28
|
|
|
|
144
|
+ */
|
|
|
|
145
|
+ public function saveHandleParam($param){
|
|
|
|
146
|
+ if(isset($this->param['describe_image']) && !empty($this->param['describe_image'])){
|
|
|
|
147
|
+ foreach ($this->param['describe_image'] as $k => $v){
|
|
|
|
148
|
+ $v = str_replace_url($v);
|
|
|
|
149
|
+ $this->param['describe_image'][$k] = $v;
|
|
|
|
150
|
+ }
|
|
|
|
151
|
+ $this->param['describe_image'] = json_encode($this->param['describe_image']);
|
|
|
|
152
|
+ }
|
|
|
|
153
|
+ $this->param['project_id'] = $this->user['project_id'];
|
|
|
|
154
|
+ return $this->success($param);
|
|
|
|
155
|
+ }
|
|
|
|
156
|
+
|
|
|
|
157
|
+ /**
|
|
138
|
* @remark :删除
|
158
|
* @remark :删除
|
|
139
|
* @name :delete
|
159
|
* @name :delete
|
|
140
|
* @author :lyh
|
160
|
* @author :lyh
|