Kaynağa Gözat

Merge branch 'master' of http://git.huaml.com/zhh/huahuibao

林琦海 5 yıl önce
ebeveyn
işleme
13be9c9e7f

+ 15 - 1
app-hd/controllers/ShopController.php

@@ -115,10 +115,24 @@ class ShopController extends BaseController
             util::fail('没有找到门店');
         }
         ShopClass::valid($shop->attributes, $this->sjId);
-        $imgUrl = ShopClass::generateGatheringCode($this->sjId, $id);
+        $imgUrl = Yii::$app->params['hdHost'] . '/shop/gathering-img-url?id=' . $id;
         util::success(['url' => $imgUrl]);
     }
 
+    public function actionGatheringImgUrl()
+    {
+        $id = Yii::$app->request->get('id', 0);
+        $shop = ShopService::getById($id, true);
+        if (empty($shop)) {
+            util::fail('没有找到门店');
+        }
+        $sjId = $shop->sjId;
+        $imgUrl = ShopClass::generateGatheringCode($sjId, $id);
+        $fileResource = file_get_contents($imgUrl);
+        header('Content-type: image/jpeg');
+        echo $fileResource;
+    }
+
     //获取小程序的收款码 ssh
     public function actionGatheringMiniCode()
     {

+ 3 - 6
biz-hd/goods/classes/CategoryClass.php

@@ -70,17 +70,14 @@ class CategoryClass extends BaseClass
         $date = date("Y-m-d H:i:s");
         $list = [
             '花束' => [
-                ['shopImg' => '["uploads\/201908\/01\/jpg\/19080166819_12358.jpg"]', 'price' => 188, 'content' => '暂无简介', 'sjId' => $sjId, 'createTime' => $date, 'updateTime' => $date, 'goodsName' => '天使美人', 'itemNumber' => stringUtil::buildRandNo($sjId) . '1',],
-                ['shopImg' => '["uploads\/201908\/01\/jpg\/19080166819_12358.jpg"]', 'price' => 288, 'content' => '暂无简介', 'sjId' => $sjId, 'createTime' => $date, 'updateTime' => $date, 'goodsName' => '转角遇到爱', 'itemNumber' => stringUtil::buildRandNo($sjId) . '2',],
+                ['shopImg' => '["uploads\/201906\/23\/jpg\/19062359040_12358.jpg","uploads\/201906\/23\/jpg\/19062381985_12358.jpg"]', 'price' => 588, 'content' => '暂无简介', 'sjId' => $sjId, 'createTime' => $date, 'updateTime' => $date, 'goodsName' => '相思', 'itemNumber' => stringUtil::buildRandNo($sjId) . '5',],
+                ['shopImg' => '["uploads\/201906\/23\/jpg\/19062352536_12358.jpg","uploads\/201906\/23\/jpg\/19062331132_12358.jpg","uploads\/201906\/23\/jpg\/19062380371_12358.jpg"]', 'price' => 688, 'content' => '暂无简介', 'sjId' => $sjId, 'createTime' => $date, 'updateTime' => $date, 'goodsName' => '女神', 'itemNumber' => stringUtil::buildRandNo($sjId) . '6',],
             ],
             '花篮' => [
                 ['shopImg' => '["uploads\/201906\/23\/jpg\/19062380217_12358.jpg","uploads\/201906\/23\/jpg\/19062339442_12358.jpg","uploads\/201906\/23\/jpg\/19062382963_12358.jpg"]', 'price' => 388, 'content' => '暂无简介', 'sjId' => $sjId, 'createTime' => $date, 'updateTime' => $date, 'goodsName' => '只此一心', 'itemNumber' => stringUtil::buildRandNo($sjId) . '3',],
                 ['shopImg' => '["uploads\/201906\/23\/jpg\/19062374848_12358.jpg","uploads\/201906\/23\/jpg\/19062372687_12358.jpg","uploads\/201906\/23\/jpg\/19062341158_12358.jpg"]', 'price' => 488, 'content' => '暂无简介', 'sjId' => $sjId, 'createTime' => $date, 'updateTime' => $date, 'goodsName' => '密语时光', 'itemNumber' => stringUtil::buildRandNo($sjId) . '4',],
             ],
-            '永生花' => [
-                ['shopImg' => '["uploads\/201906\/23\/jpg\/19062359040_12358.jpg","uploads\/201906\/23\/jpg\/19062381985_12358.jpg"]', 'price' => 588, 'content' => '暂无简介', 'sjId' => $sjId, 'createTime' => $date, 'updateTime' => $date, 'goodsName' => '相思', 'itemNumber' => stringUtil::buildRandNo($sjId) . '5',],
-                ['shopImg' => '["uploads\/201906\/23\/jpg\/19062352536_12358.jpg","uploads\/201906\/23\/jpg\/19062331132_12358.jpg","uploads\/201906\/23\/jpg\/19062380371_12358.jpg"]', 'price' => 688, 'content' => '暂无简介', 'sjId' => $sjId, 'createTime' => $date, 'updateTime' => $date, 'goodsName' => '女神', 'itemNumber' => stringUtil::buildRandNo($sjId) . '6',],
-            ],
+            '永生花' => [],
             '绿植' => []
         ];
         foreach ($list as $key => $goodsList) {