作者 lyh

gxbanner图片

@@ -86,6 +86,7 @@ class CustomModuleCategoryLogic extends BaseLogic @@ -86,6 +86,7 @@ class CustomModuleCategoryLogic extends BaseLogic
86 $this->fail('当前数据不存在或已被删除'); 86 $this->fail('当前数据不存在或已被删除');
87 } 87 }
88 $info['image'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']); 88 $info['image'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']);
  89 + $info['banner_image'] = getImageUrl($info['banner_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
89 return $this->success($info); 90 return $this->success($info);
90 } 91 }
91 92
@@ -118,6 +119,9 @@ class CustomModuleCategoryLogic extends BaseLogic @@ -118,6 +119,9 @@ class CustomModuleCategoryLogic extends BaseLogic
118 if(!isset($param['id']) || empty($param['id'])){ 119 if(!isset($param['id']) || empty($param['id'])){
119 $param['project_id'] = $this->user['project_id']; 120 $param['project_id'] = $this->user['project_id'];
120 } 121 }
  122 + if(isset($param['banner_image']) && !empty($param['banner_image'])){
  123 + $param['banner_image'] = str_replace_url($param['banner_image']);
  124 + }
121 if(isset($param['image']) && !empty($param['image'])){ 125 if(isset($param['image']) && !empty($param['image'])){
122 $param['image'] = str_replace_url($param['image']); 126 $param['image'] = str_replace_url($param['image']);
123 } 127 }
@@ -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'])){