From 845b80a68024a880f1f8a35587b5a1e213f25a5e Mon Sep 17 00:00:00 2001
From: heshupeng <hsp@bronet.cn>
Date: Fri, 8 Jan 2021 10:41:06 +0800
Subject: [PATCH] 商品轮播图

---
 addons/shopro/model/Goods.php        |  4 ++--
 application/api/controller/Goods.php |  7 ++++---
 public/api.html                      |  9 +++++----
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/addons/shopro/model/Goods.php b/addons/shopro/model/Goods.php
index c373b9b..e276fbd 100644
--- a/addons/shopro/model/Goods.php
+++ b/addons/shopro/model/Goods.php
@@ -627,9 +627,9 @@ class Goods extends Model
                 $newImagesArray[$k]['url'] = cdnurl($v, true);
                 $info = pathinfo($v);
                 if(in_array($info['extension'],['jpg','png','bmp','jpeg','gif'])){
-                    $newImagesArray[$k]['type'] = 'video';
-                }else{
                     $newImagesArray[$k]['type'] = 'image';
+                }else{
+                    $newImagesArray[$k]['type'] = 'video';
                 }
             }
             return $newImagesArray;
diff --git a/application/api/controller/Goods.php b/application/api/controller/Goods.php
index 4b0b2ad..fc9edf0 100644
--- a/application/api/controller/Goods.php
+++ b/application/api/controller/Goods.php
@@ -101,9 +101,10 @@ class Goods extends Base
             "weigh": 0,
             "category_ids": "3",
             "image": "http://www.ant.top/assets/img/qrcode.png", //商品主图
-            "images": [ //轮播图
-                "http://www.ant.top/uploads/20201211/ceaf516172280f5da413fb020bf777c9.png"
-            ],
+            "images": [{ //轮播图
+                "url": "https://yixiaoxian.qiniu.broing.cn/uploads/20201224/FpqzUt7YTrXlZUsarlqD8heEHA4O.png", //文件地址
+                "type": "image" //类型:image=图片,video=视频
+            }],
             "params": [{
                 "title": "50",
                 "content": "123"
diff --git a/public/api.html b/public/api.html
index ee7dd8c..ba0a91c 100755
--- a/public/api.html
+++ b/public/api.html
@@ -7901,9 +7901,10 @@
             "weigh": 0,
             "category_ids": "3",
             "image": "http://www.ant.top/assets/img/qrcode.png", //商品主图
-            "images": [ //轮播图
-                "http://www.ant.top/uploads/20201211/ceaf516172280f5da413fb020bf777c9.png"
-            ],
+            "images": [{ //轮播图
+                "url": "https://yixiaoxian.qiniu.broing.cn/uploads/20201224/FpqzUt7YTrXlZUsarlqD8heEHA4O.png", //文件地址
+                "type": "image" //类型:image=图片,video=视频
+            }],
             "params": [{
                 "title": "50",
                 "content": "123"
@@ -10233,7 +10234,7 @@
 
             <div class="row mt0 footer">
                 <div class="col-md-6" align="left">
-                    Generated on 2021-01-01 10:25:15                </div>
+                    Generated on 2021-01-08 10:40:05                </div>
                 <div class="col-md-6" align="right">
                     <a href="./" target="_blank">My Website</a>
                 </div>
--
libgit2 0.24.0