Ver Fonte

新增:微信小程序设置项《发货信息管理》

萤火科技 há 1 ano atrás
pai
commit
8af220f1a4

+ 2 - 2
app/common/library/wechat/Shipping.php

@@ -15,8 +15,8 @@ namespace app\common\library\wechat;
 use cores\exception\BaseException;
 
 /**
- * 发货信息录入接口
- * Class wechat
+ * 发货信息管理接口
+ * Class Shipping
  * @package app\library
  */
 class Shipping extends WxBase

+ 4 - 2
app/common/model/wxapp/Setting.php

@@ -133,12 +133,14 @@ class Setting extends BaseModel
                 'key' => 'basic',
                 'describe' => '基础设置',
                 'values' => [
-                    // 是否启用微信小程序端访问
+                    // 是否开启微信小程序端访问
                     'enabled' => true,
                     // 小程序AppID
                     'app_id' => '',
                     // 小程序AppSecret
-                    'app_secret' => ''
+                    'app_secret' => '',
+                    // 是否开启发货信息管理
+                    'enableShipping' => true,
                 ]
             ]
         ];

+ 1 - 1
app/common/service/order/Shipping.php

@@ -100,7 +100,7 @@ class Shipping extends BaseService
     {
         // 设置默认的参数
         $param = helper::setQueryDefaultValue($param, [
-            // 同步至微信小程序《发货信息录入》
+            // 同步至微信小程序《发货信息管理》
             'syncMpWeixinShipping' => 1,
             // 物流模式:1物流配送 3虚拟商品 4用户自提
             'logisticsType' => self::DELIVERY_EXPRESS,

+ 1 - 1
app/store/model/wxapp/Setting.php

@@ -44,7 +44,7 @@ class Setting extends SettingModel
         return $model->save([
             'key' => $key,
             'describe' => $this->describe[$key],
-            'values' => helper::pick($values, ['enabled', 'app_id', 'app_secret']),
+            'values' => helper::pick($values, ['enabled', 'app_id', 'app_secret', 'enableShipping']),
             'update_time' => time(),
             'store_id' => self::$storeId,
         ]);

+ 2 - 2
app/store/service/order/Delivery.php

@@ -64,7 +64,7 @@ class Delivery extends BaseService
             $completed = OrderModel::detail($orderId, ['goods', 'trade']);
             // 发货信息同步微信平台
             (new ShippingService)->syncMpWeixinShipping($completed, [
-                // 同步至微信小程序《发货信息录入》
+                // 同步至微信小程序《发货信息管理》
                 'syncMpWeixinShipping' => $param['syncMpWeixinShipping'],
                 // 物流模式:1物流配送 3虚拟商品 4用户自提
                 'logisticsType' => [
@@ -100,7 +100,7 @@ class Delivery extends BaseService
             'isAllPack' => false,
             // 发货的商品
             'packGoodsData' => [],
-            // 同步至微信小程序《发货信息录入》
+            // 同步至微信小程序《发货信息管理》
             'syncMpWeixinShipping' => 1,
         ]);
     }