Selaa lähdekoodia

二维码收款

shish 10 kuukautta sitten
vanhempi
commit
0fee27d837

+ 14 - 2
app-ghs/controllers/ShopController.php

@@ -30,6 +30,18 @@ class ShopController extends BaseController
 
     public $guestAccess = ['all'];
 
+    //小程序端使用,下载收款码 ssh 20250821
+    public function actionMiniGatheringCode()
+    {
+        $shop = $this->shop;
+        $lsShopId = $shop->lsShopId ?? 0;
+        if (empty($lsShopId)) {
+            util::fail('没有零售店ID');
+        }
+        $imgUrl = ShopClass::generateGatheringCode($this->sjId, $lsShopId);
+        util::success(['imgUrl' => $imgUrl]);
+    }
+
     //修改客户微信二维码 ssh 20240714
     public function actionChangeWx()
     {
@@ -177,10 +189,10 @@ class ShopController extends BaseController
 
         //同步更新同城配送微信门店
         // 校验有无经纬度数据,没有不更新(说明地图定位功能不可用了)
-        if($post['lat'] != '' && $post['long'] != '') {
+        if ($post['lat'] != '' && $post['long'] != '') {
             $shopExt = \bizGhs\shop\classes\MainClass::getById($this->mainId, false, false, 'id, wxStoreId');
             if ($shopExt['wxStoreId'] == '') {
-                Yii::error(__CLASS__ . __METHOD__ .' - 未创建门店,请先创建');
+                Yii::error(__CLASS__ . __METHOD__ . ' - 未创建门店,请先创建');
                 util::complete();
             }
 

+ 2 - 3
app-hd/controllers/ShopController.php

@@ -119,10 +119,10 @@ class ShopController extends BaseController
 
         //同步更新同城配送微信门店
         // 校验有无经纬度数据,没有不更新(说明地图定位功能不可用了)
-        if($data['lat'] != '' && $data['long'] != '') {
+        if ($data['lat'] != '' && $data['long'] != '') {
             $shopExt = MainClass::getById($this->mainId, false, false, 'id, wxStoreId');
             if ($shopExt['wxStoreId'] == '') {
-                Yii::error(__CLASS__ . __METHOD__ .' - 未创建门店,请先创建');
+                Yii::error(__CLASS__ . __METHOD__ . ' - 未创建门店,请先创建');
                 util::complete();
             }
 
@@ -261,7 +261,6 @@ class ShopController extends BaseController
     {
         $shop = $this->shop;
         $shopId = $shop->id;
-        ShopClass::valid($shop->attributes, $this->sjId);
         $imgUrl = ShopClass::generateGatheringCode($this->sjId, $shopId);
         util::success(['imgUrl' => $imgUrl]);
     }

+ 1 - 1
common/components/qrCodeUtil.php

@@ -221,7 +221,7 @@ class qrCodeUtil
         }
         $behind = $middle . $sjId . '_' . $shopId . '.png';
         $saveFile = $prefix . $behind;
-        if (file_exists($saveFile) == false) {
+        if (!file_exists($saveFile)) {
             \QRcode::png($url, $saveFile, $errorCorrectionLevel, $matrixPointSize, 1);//最后的参数1表示空白间距
             oss::uploadImage($behind, $saveFile);
         }