Explorar o código

新订单提示方式调整

shish %!s(int64=5) %!d(string=hai) anos
pai
achega
ab6509daaa
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      biz/wx/classes/WxMessageClass.php

+ 8 - 1
biz/wx/classes/WxMessageClass.php

@@ -121,6 +121,13 @@ class WxMessageClass extends BaseClass
         }
         }
         $orderId = $order->id;
         $orderId = $order->id;
         $actPrice = $order->actPrice;
         $actPrice = $order->actPrice;
+
+        $first = "您有新的订单,请注意查收";
+        $customName = $order->customName ?? '';
+        if (!empty($customName)) {
+            $first = $customName . '下单';
+        }
+
         $adminList = ShopAdminClass::getRemainAdmin($shopId);
         $adminList = ShopAdminClass::getRemainAdmin($shopId);
         foreach ($adminList as $admin) {
         foreach ($adminList as $admin) {
             if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
             if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
@@ -132,7 +139,7 @@ class WxMessageClass extends BaseClass
                 "template_id" => $tempId,
                 "template_id" => $tempId,
                 "url" => Yii::$app->params['ghsDomain'],
                 "url" => Yii::$app->params['ghsDomain'],
                 "data" => [
                 "data" => [
-                    "first" => ["value" => "您有新的订单,请注意查收", "color" => "#173177"],
+                    "first" => ["value" => $first, "color" => "#173177"],
                     "keyword1" => ["value" => $order->orderSn, "color" => "#173177"],
                     "keyword1" => ["value" => $order->orderSn, "color" => "#173177"],
                     "keyword2" => ["value" => $actPrice, "color" => "#173177"],
                     "keyword2" => ["value" => $actPrice, "color" => "#173177"],
                     "keyword3" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
                     "keyword3" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],