Explorar o código

Merge branch 'master' into after-sale

shish hai 22 horas
pai
achega
37695a6e49

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

@@ -684,7 +684,7 @@ class PurchaseController extends BaseController
                             $post['sendCost'] = bcadd($post['sendCost'] ?? 0, $sendCost, 2);
                             $post['sendDistance'] = $sendDistance;
 
-                            noticeUtil::push("自定义运费计算:" . $sendCost . "|" . $post['sendCost'] . " 数量:{$productCount} 金额:{$shMethodItemAmount}  距离:" . $distanceMeters . " config:" . json_encode($shCurrentConfig), '15280215347');
+                            //noticeUtil::push("自定义运费计算:" . $sendCost . "|" . $post['sendCost'] . " 数量:{$productCount} 金额:{$shMethodItemAmount}  距离:" . $distanceMeters . " config:" . json_encode($shCurrentConfig), '15280215347');
                         } else {
                             // 使用 DeliveryQuoteUtil 获取配送报价
                             try {

+ 4 - 4
biz-ghs/order/classes/OrderClass.php

@@ -3132,7 +3132,7 @@ XL;
         /**************************如果是好多花的云仓还要再打一下标签纸,多处要同步修改,关键词 hdh_yc *****************************/
         $orderMainId = $order->mainId;
         if (getenv('YII_ENV') == 'production') {
-            $map = [65726, 58, 25119, 28500, 1294, 12925, 2644, 10652, 2084, 89473, 83694];
+            $map = [65726, 58, 25119, 28500, 1294, 12925, 2644, 10652, 2084, 89473, 83694, 52];
         } else {
             $map = [828, 644];
         }
@@ -3157,7 +3157,7 @@ XL;
             }
         }
         //东莞我要花 手机后四号变星号
-        if (in_array((int)$orderMainId, [2644, 10652, 89473], true)) {
+        if (in_array((int)$orderMainId, [2644, 10652, 89473, 52], true)) {
             $customMobile = preg_replace('/(.{4})$/u', '****', trim($customMobile));
         }
         $customName = $order->customName ?? '';
@@ -3238,8 +3238,8 @@ XL;
             if (!empty($showAddress)) {
                 $content .= '<TEXT x="230" y="45" font="12" w="1" h="2" r="90">' . $showAddress . '</TEXT>';
             }
-            $content .= '<TEXT x="140" y="45" font="12" w="2" h="2" r="90">' . $customMobile . '  ' . $itemNum . '扎</TEXT>';
-            $content .= '<TEXT x="66" y="45" font="12" w="2" h="2" r="90">' . $distName . ' ' . $payDate . '</TEXT>';
+            $content .= '<TEXT x="140" y="45" font="12" w="2" h="2" r="90">' . $customMobile . '  '. $itemNum . '扎  ' . $payDate . '</TEXT>';
+            $content .= '<TEXT x="66" y="45" font="12" w="2" h="2" r="90">' . $distName . ' 【' . $currentName . '】</TEXT>';
             /**************************如果是好多花的云仓还要再打一下标签纸,多处要同步修改,关键词 hdh_yc *****************************/
         }
         $p->printLabelMsg($content);

+ 12 - 4
common/components/mapUtil.php

@@ -27,13 +27,18 @@ class mapUtil
         return Json::decode($result);
     }
 
-    //计算距离 lng经度 lat纬度 ssh 2020.5.14
+    /**
+     * 计算两点骑行距离(米)。
+     * 使用高德普通骑行路径规划 /v5/direction/bicycling(配额更宽);
+     * 不再用 electrobike 电动车接口(高级服务,日调用量通常很低)。
+     * 与电动车路线相比,城市场景一般差几十到一两百米,少数因限行差异可能更大,运费场景可接受。
+     */
     public static function calculateDistance($fromLnt, $fromLat, $toLnt, $toLat)
     {
         if (getenv('YII_ENV') == 'production') {
-            $url = "https://restapi.amap.com/v5/direction/electrobike?key=" . self::$thirdMapKey . '&origin=' . $fromLnt . ',' . $fromLat . '&destination=' . $toLnt . ',' . $toLat;
+            $url = "https://restapi.amap.com/v5/direction/bicycling?key=" . self::$thirdMapKey . '&origin=' . $fromLnt . ',' . $fromLat . '&destination=' . $toLnt . ',' . $toLat;
         } else {
-            $url = "http://restapi.amap.com/v5/direction/electrobike?key=" . self::$thirdMapKey . '&origin=' . $fromLnt . ',' . $fromLat . '&destination=' . $toLnt . ',' . $toLat;
+            $url = "http://restapi.amap.com/v5/direction/bicycling?key=" . self::$thirdMapKey . '&origin=' . $fromLnt . ',' . $fromLat . '&destination=' . $toLnt . ',' . $toLat;
         }
         $curl = new curl\Curl();
         $result = $curl->get($url);
@@ -53,7 +58,10 @@ class mapUtil
         return $distance;
     }
 
-    //计算客户到店距离,骑电动车 ssh 2026.7.30
+    /**
+     * 计算客户到店骑行距离(内部仍走 calculateDistance=普通骑行)。
+     * 方法名保留 EleBike 兼容已有调用方,实际已非电动车接口。
+     */
     public static function calcShopDistanceByEleBike($beginPlace, $toPlace, $report = 1)
     {
         $beginLnt = $beginPlace->long ?? '';