Parcourir la source

跑腿配送是否开启及获取配送规则

shizhongqi il y a 7 mois
Parent
commit
d4daabc7de

+ 11 - 0
app-ghs/controllers/MerchantController.php

@@ -6,6 +6,7 @@ use biz\shop\classes\ShopAdminClass;
 use biz\sj\classes\MerchantClass;
 use biz\sj\services\MerchantExtendService;
 use biz\sj\services\MerchantService;
+use bizGhs\merchant\classes\ShopClass;
 use bizHd\saas\services\SetAuthService;
 use Yii;
 use common\components\util;
@@ -42,6 +43,16 @@ class MerchantController extends BaseController
         $merchant['shopInfo'] = $this->shop;
         $ext = isset($this->sjExtend) && !empty($this->sjExtend) ? $this->sjExtend->attributes : [];
         $merchant = MerchantService::getInfo($merchant, $ext);
+
+        //跑腿配送是否开启及获取配送规则
+        $ghsShop = ShopClass::getById($this->shopId, true);
+        $intraCityRet = \biz\shop\classes\ShopClass::hasIntraCity($ghsShop);
+        $merchant['openIntraCity'] = $intraCityRet['openIntraCity'];
+        $merchant['hcFreeKm'] = $intraCityRet['hcFreeKm'];
+        $merchant['hcMap'] = $intraCityRet['hcMap'];
+        $merchant['hsFreeKm'] = $intraCityRet['hsFreeKm'];
+        $merchant['hsAddFee'] = $intraCityRet['hsAddFee'];
+
         util::success($merchant);
     }
 

+ 1 - 1
app-hd/controllers/GhsController.php

@@ -306,7 +306,7 @@ class GhsController extends BaseController
 
         //判断是否开启同城配送功能
         $intraCityRet = ShopClass::hasIntraCity($ghsShop);
-        $openIntraCity = $intraCityRet['openIntraCity'] ?? 0;
+        $openIntraCity = $intraCityRet['openIntraCity'];
         $ghsInfo['openIntraCity'] = $openIntraCity;
 
         //花材的免费配送设置