shish 3 år sedan
förälder
incheckning
a9ad7bfafe
1 ändrade filer med 27 tillägg och 0 borttagningar
  1. 27 0
      biz/shop/classes/ShopExtClass.php

+ 27 - 0
biz/shop/classes/ShopExtClass.php

@@ -292,6 +292,33 @@ class ShopExtClass extends BaseClass
         }
     }
 
+    //供货商收款声音播放 ssh 20230421
+    public static function ghsGatheringReport($order)
+    {
+        if ($order->fromType != dict::getDict("fromType", "shop")) {
+            //非门店订单不播报语音
+            return false;
+        }
+        if ($order->onlinePay == dict::getDict('onlinePay', 'not')) {
+            //非在线支付的不播报
+            return false;
+        }
+        if ($order->payStatus != 1) {
+            //还没有付款订单不播报
+            return false;
+        }
+        $shopId = $order->shopId ?? 0;
+        $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);
+        if (isset($shopExt->lbSn) && !empty($shopExt->lbSn)) {
+            $actPrice = $order->actPrice ? floatval($order->actPrice) : 0;
+            $payWay = $order->payWay ?? dict::getDict('payWay', 'wxPay');
+            $sound = $payWay == dict::getDict('payWay', 'wxPay') ? "微信收款{$actPrice}元,谢谢惠顾,欢迎下次光临" : "支付宝收款{$actPrice}元,谢谢惠顾,欢迎下次光临";
+            $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version={$shopExt->lbVersion}&message=" . $sound;
+            $curl = new curl\Curl();
+            $curl->get($url);
+        }
+    }
+
     //清除所有小菊
     public static function clearXjALl($shopId)
     {