Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop
正在显示
1 个修改的文件
包含
11 行增加
和
3 行删除
| @@ -396,20 +396,28 @@ class ProductLogic extends BaseLogic | @@ -396,20 +396,28 @@ class ProductLogic extends BaseLogic | ||
| 396 | } | 396 | } |
| 397 | 397 | ||
| 398 | $gallery = []; | 398 | $gallery = []; |
| 399 | + $thumb = ''; | ||
| 399 | if($data[7]){ | 400 | if($data[7]){ |
| 400 | - //处理图片集 | 401 | + //处理图片 |
| 401 | $img_arr = explode(',',$data[7]); | 402 | $img_arr = explode(',',$data[7]); |
| 402 | foreach ($img_arr as $v_img){ | 403 | foreach ($img_arr as $v_img){ |
| 403 | $one_img = CosService::uploadRemote($project_id,'image_product',$v_img); | 404 | $one_img = CosService::uploadRemote($project_id,'image_product',$v_img); |
| 404 | if($one_img){ | 405 | if($one_img){ |
| 405 | - $gallery[] = [ | 406 | + $one_gallery = [ |
| 406 | 'alt' => '这是一张产品图', | 407 | 'alt' => '这是一张产品图', |
| 407 | 'url' => $one_img | 408 | 'url' => $one_img |
| 408 | ]; | 409 | ]; |
| 410 | + | ||
| 411 | + if(!$thumb){ | ||
| 412 | + $thumb = Arr::a2s($one_gallery); | ||
| 413 | + } | ||
| 414 | + | ||
| 415 | + $gallery[] = $one_gallery; | ||
| 409 | } | 416 | } |
| 410 | } | 417 | } |
| 411 | } | 418 | } |
| 412 | 419 | ||
| 420 | + | ||
| 413 | //处理seo | 421 | //处理seo |
| 414 | $seo_mate = [ | 422 | $seo_mate = [ |
| 415 | 'title' => $data[8]??'', | 423 | 'title' => $data[8]??'', |
| @@ -423,7 +431,7 @@ class ProductLogic extends BaseLogic | @@ -423,7 +431,7 @@ class ProductLogic extends BaseLogic | ||
| 423 | [ | 431 | [ |
| 424 | 'project_id' => $project_id, | 432 | 'project_id' => $project_id, |
| 425 | 'title' => $data[0], | 433 | 'title' => $data[0], |
| 426 | - 'thumb' => $gallery[0] ? Arr::a2s($gallery[0]) : '', | 434 | + 'thumb' => $thumb, |
| 427 | 'gallery' => Arr::a2s($gallery), | 435 | 'gallery' => Arr::a2s($gallery), |
| 428 | 'attrs' => $data[4] ? $data[4] : Arr::a2s([]), | 436 | 'attrs' => $data[4] ? $data[4] : Arr::a2s([]), |
| 429 | 'category_id' => $category_id, | 437 | 'category_id' => $category_id, |
-
请 注册 或 登录 后发表评论