|
@@ -33,12 +33,29 @@ class NewsCategoryLogic extends BaseLogic |
|
@@ -33,12 +33,29 @@ class NewsCategoryLogic extends BaseLogic |
|
33
|
$info = $this->model->read($this->param);
|
33
|
$info = $this->model->read($this->param);
|
|
34
|
$info['url'] = $this->user['domain'] . $info['alias'];
|
34
|
$info['url'] = $this->user['domain'] . $info['alias'];
|
|
35
|
if(!empty($info['banner_image'])){
|
35
|
if(!empty($info['banner_image'])){
|
|
36
|
- $info['banner_image_link'] = getImageUrl($info['banner_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
|
36
|
+ $info['banner_image'] = getImageUrl($info['banner_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
|
|
37
|
}
|
37
|
}
|
|
38
|
return $this->success($info);
|
38
|
return $this->success($info);
|
|
39
|
}
|
39
|
}
|
|
40
|
|
40
|
|
|
41
|
/**
|
41
|
/**
|
|
|
|
42
|
+ * @remark :保存处理字段
|
|
|
|
43
|
+ * @name :handleParam
|
|
|
|
44
|
+ * @author :lyh
|
|
|
|
45
|
+ * @method :post
|
|
|
|
46
|
+ * @time :2024/9/13 9:15
|
|
|
|
47
|
+ */
|
|
|
|
48
|
+ public function handleParam($param)
|
|
|
|
49
|
+ {
|
|
|
|
50
|
+ if(isset($param['banner_image']) && !empty($param['banner_image'])){
|
|
|
|
51
|
+ $param['banner_image'] = str_replace_url($param['banner_image']);
|
|
|
|
52
|
+ }
|
|
|
|
53
|
+ if(isset($param['image']) && !empty($param['image'])){
|
|
|
|
54
|
+ $param['image'] = str_replace_url($param['image']);
|
|
|
|
55
|
+ }
|
|
|
|
56
|
+ return $this->success($param);
|
|
|
|
57
|
+ }
|
|
|
|
58
|
+ /**
|
|
42
|
* @remark :保存数据
|
59
|
* @remark :保存数据
|
|
43
|
* @name :newsCategorySave
|
60
|
* @name :newsCategorySave
|
|
44
|
* @author :lyh
|
61
|
* @author :lyh
|
|
@@ -48,6 +65,7 @@ class NewsCategoryLogic extends BaseLogic |
|
@@ -48,6 +65,7 @@ class NewsCategoryLogic extends BaseLogic |
|
48
|
public function newsCategorySave(){
|
65
|
public function newsCategorySave(){
|
|
49
|
//验证名称是否存在
|
66
|
//验证名称是否存在
|
|
50
|
$this->verifyParamName($this->param['name']);
|
67
|
$this->verifyParamName($this->param['name']);
|
|
|
|
68
|
+ $this->param = $this->handleParam($this->param);
|
|
51
|
DB::beginTransaction();
|
69
|
DB::beginTransaction();
|
|
52
|
try {
|
70
|
try {
|
|
53
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
71
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|