作者 赵彬吉
@@ -96,8 +96,6 @@ class DomainInfo extends Command @@ -96,8 +96,6 @@ class DomainInfo extends Command
96 'cert' => '' 96 'cert' => ''
97 ]; 97 ];
98 $result = $this->curlRequest($url, $param); 98 $result = $this->curlRequest($url, $param);
99 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND);  
100 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($param['domain'], true) . PHP_EOL, FILE_APPEND);  
101 } 99 }
102 100
103 public static function getTopDomain ($url) { 101 public static function getTopDomain ($url) {
@@ -305,8 +305,7 @@ class FileController @@ -305,8 +305,7 @@ class FileController
305 public function setUrl(){ 305 public function setUrl(){
306 //A端上传 306 //A端上传
307 if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){ 307 if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){
308 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('进入222', true) . PHP_EOL, FILE_APPEND);  
309 - $this->path = $this->uploads['path_a'].'/'.$this->file_type[$this->param['refer']].'/'.date('Y-m'); 308 + $this->path = $this->uploads['path_a'].'/'.$this->file_type[$this->param['refer']].'/'.date('Y-m');
310 }else{ 309 }else{
311 //B端上传,upload_method 为 1时 强制上传到本地 310 //B端上传,upload_method 为 1时 强制上传到本地
312 if(!isset($this->param['upload_method'])) { 311 if(!isset($this->param['upload_method'])) {
@@ -273,20 +273,14 @@ class ProductLogic extends BaseLogic @@ -273,20 +273,14 @@ class ProductLogic extends BaseLogic
273 $param['gallery'] = Arr::a2s($param['gallery'] ?? []); 273 $param['gallery'] = Arr::a2s($param['gallery'] ?? []);
274 } 274 }
275 if(isset($param['files'])){ 275 if(isset($param['files'])){
276 - foreach ($param['files'] as $k => $v){  
277 - $v['url'] = str_replace_url($v['url']);  
278 - $param['files'][$k] = $v;  
279 - } 276 + $param['files']['url'] = str_replace_url($param['files']['url']);
280 $param['files'] = Arr::a2s($param['files'] ?? []); 277 $param['files'] = Arr::a2s($param['files'] ?? []);
281 } 278 }
282 if(isset($param['video'])){ 279 if(isset($param['video'])){
283 - foreach ($param['video'] as $k => $v){  
284 - $v['url'] = str_replace_url($v['url']);  
285 - $param['video'][$k] = $v;  
286 - } 280 + $param['video']['url'] = str_replace_url($param['video']['url']);
287 $param['video'] = Arr::a2s($param['video'] ?? []); 281 $param['video'] = Arr::a2s($param['video'] ?? []);
288 } 282 }
289 - if(isset($param['keyword_id'])){ 283 + if(isset($param['keyword_id']) && !empty($param['keyword_id'])){
290 $param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).','; 284 $param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).',';
291 } 285 }
292 $param['attrs'] = Arr::a2s($param['attrs'] ?? []); 286 $param['attrs'] = Arr::a2s($param['attrs'] ?? []);
@@ -175,11 +175,8 @@ class Product extends Base @@ -175,11 +175,8 @@ class Product extends Base
175 public function getFilesAttribute($value){ 175 public function getFilesAttribute($value){
176 if(!empty($value)){ 176 if(!empty($value)){
177 $value = Arr::s2a($value); 177 $value = Arr::s2a($value);
178 - foreach ($value as $k => $v){  
179 - if(!empty($v['url'])){  
180 - $v['url'] = getImageUrl($v['url']);  
181 - }  
182 - $value[$k] = $v; 178 + if(!empty($value['url'])){
  179 + $value['url'] = getImageUrl($value['url']);
183 } 180 }
184 } 181 }
185 return $value; 182 return $value;
@@ -195,11 +192,9 @@ class Product extends Base @@ -195,11 +192,9 @@ class Product extends Base
195 public function getVideoAttribute($value){ 192 public function getVideoAttribute($value){
196 if(!empty($value)){ 193 if(!empty($value)){
197 $value = Arr::s2a($value); 194 $value = Arr::s2a($value);
198 - foreach ($value as $k => $v){  
199 - if(!empty($v['url'])){  
200 - $v['url'] = getImageUrl($v['url']);  
201 - }  
202 - $value[$k] = $v; 195 + $value = Arr::s2a($value);
  196 + if(!empty($value['url'])){
  197 + $value['url'] = getImageUrl($value['url']);
203 } 198 }
204 } 199 }
205 return $value; 200 return $value;