作者 lyh

gx

@@ -4,4 +4,4 @@ @@ -4,4 +4,4 @@
4 <center><h1>404 Not Found</h1></center> 4 <center><h1>404 Not Found</h1></center>
5 <hr><center>nginx</center> 5 <hr><center>nginx</center>
6 </body> 6 </body>
7 -</html>  
  7 +</html>
@@ -62,26 +62,6 @@ class ProductLogic extends BaseLogic @@ -62,26 +62,6 @@ class ProductLogic extends BaseLogic
62 } 62 }
63 63
64 /** 64 /**
65 - * @remark :编辑产品  
66 - * @name :editProduct  
67 - * @author :lyh  
68 - * @method :post  
69 - * @time :2023/9/7 10:02  
70 - */  
71 - public function editProductRoute($id,$route){  
72 - $info = $this->model->read(['id'=>$this->param['id']]);  
73 - if($info['route'] != $route){  
74 - //生成一条删除路由记录  
75 - $data = [  
76 - 'source'=>RouteMap::SOURCE_PRODUCT,  
77 - 'route'=>$route,  
78 - ];  
79 - $this->setRouteDeleteSave($data);  
80 - }  
81 - return $id;  
82 - }  
83 -  
84 - /**  
85 * @remark :不使用save处理参数 65 * @remark :不使用save处理参数
86 * @name :handleSaveParam 66 * @name :handleSaveParam
87 * @author :lyh 67 * @author :lyh
@@ -89,6 +69,7 @@ class ProductLogic extends BaseLogic @@ -89,6 +69,7 @@ class ProductLogic extends BaseLogic
89 * @time :2023/8/21 17:03 69 * @time :2023/8/21 17:03
90 */ 70 */
91 public function handleSaveParam(&$param){ 71 public function handleSaveParam(&$param){
  72 + //产品图
92 if(isset($param['gallery']) && !empty($param['gallery'])){ 73 if(isset($param['gallery']) && !empty($param['gallery'])){
93 foreach ($param['gallery'] as $k => $v){ 74 foreach ($param['gallery'] as $k => $v){
94 $v['url'] = str_replace_url($v['url']); 75 $v['url'] = str_replace_url($v['url']);
@@ -97,14 +78,30 @@ class ProductLogic extends BaseLogic @@ -97,14 +78,30 @@ class ProductLogic extends BaseLogic
97 $param['thumb'] = Arr::a2s($param['gallery'][0] ?? ''); 78 $param['thumb'] = Arr::a2s($param['gallery'][0] ?? '');
98 $param['gallery'] = Arr::a2s($param['gallery'] ?? ''); 79 $param['gallery'] = Arr::a2s($param['gallery'] ?? '');
99 } 80 }
100 - $param['attrs'] = Arr::a2s($param['attrs'] ?? '');  
101 - $param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? '');  
102 - $param['category_id'] = ','.Arr::arrToSet($param['category_id']).',';  
103 - $param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).',';  
104 - $param['describe'] = Arr::a2s($param['describe'] ?? '');  
105 - $param['describe_id'] = Arr::arrToSet($param['describe_id'] ?? '');  
106 - $param['seo_mate'] = Arr::a2s($param['seo_mate'] ?? '');  
107 - $param['related_product_id'] = Arr::arrToSet($param['related_product_id'] ?? ''); 81 + if(isset($param['attrs']) && !empty($param['attrs'])){
  82 + $param['attrs'] = Arr::a2s($param['attrs'] ?? '');
  83 + }
  84 + if(isset($param['attr_id']) && !empty($param['attr_id'])){
  85 + $param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? '');
  86 + }
  87 + if(isset($param['category_id']) && !empty($param['category_id'])){
  88 + $param['category_id'] = ','.Arr::arrToSet($param['category_id']).',';
  89 + }
  90 + if(isset($param['keyword_id']) && !empty($param['keyword_id'])){
  91 + $param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).',';
  92 + }
  93 + if(isset($param['describe']) && !empty($param['describe'])){
  94 + $param['describe'] = Arr::a2s($param['describe'] ?? '');
  95 + }
  96 + if(isset($param['describe_id']) && !empty($param['describe_id'])){
  97 + $param['describe_id'] = Arr::arrToSet($param['describe_id'] ?? '');
  98 + }
  99 + if(isset($param['seo_mate']) && !empty($param['seo_mate'])){
  100 + $param['seo_mate'] = Arr::a2s($param['seo_mate'] ?? '');
  101 + }
  102 + if(isset($param['related_product_id']) && !empty($param['related_product_id'])){
  103 + $param['related_product_id'] = Arr::arrToSet($param['related_product_id'] ?? '');
  104 + }
108 if(isset($param['icon']) && !empty($param['icon'])){ 105 if(isset($param['icon']) && !empty($param['icon'])){
109 foreach ($param['icon'] as $k1 => $v1){ 106 foreach ($param['icon'] as $k1 => $v1){
110 $param['icon'][$k1] = str_replace_url($v1); 107 $param['icon'][$k1] = str_replace_url($v1);
@@ -115,6 +112,25 @@ class ProductLogic extends BaseLogic @@ -115,6 +112,25 @@ class ProductLogic extends BaseLogic
115 return $param; 112 return $param;
116 } 113 }
117 114
  115 + /**
  116 + * @remark :编辑产品
  117 + * @name :editProduct
  118 + * @author :lyh
  119 + * @method :post
  120 + * @time :2023/9/7 10:02
  121 + */
  122 + public function editProductRoute($id,$route){
  123 + $info = $this->model->read(['id'=>$this->param['id']]);
  124 + if($info['route'] != $route){
  125 + //生成一条删除路由记录
  126 + $data = [
  127 + 'source'=>RouteMap::SOURCE_PRODUCT,
  128 + 'route'=>$route,
  129 + ];
  130 + $this->setRouteDeleteSave($data);
  131 + }
  132 + return $id;
  133 + }
118 134
119 /** 135 /**
120 * @remark :删除数据 136 * @remark :删除数据
@@ -22,4 +22,5 @@ use App\Models\Base; @@ -22,4 +22,5 @@ use App\Models\Base;
22 class AreaTimezone extends Base 22 class AreaTimezone extends Base
23 { 23 {
24 protected $table = 'gl_area_timezone'; 24 protected $table = 'gl_area_timezone';
  25 +
25 } 26 }