Browse Source

新制作单通知

shish 3 years ago
parent
commit
af9e99ef4f
2 changed files with 9 additions and 4 deletions
  1. 3 0
      app-mall/controllers/NoticeController.php
  2. 6 4
      biz/shop/classes/ShopExtClass.php

+ 3 - 0
app-mall/controllers/NoticeController.php

@@ -132,6 +132,9 @@ class NoticeController extends PublicController
                 WxMessageClass::hdNewOrderInform($shop, $order);
             }
 
+            $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);
+            ShopExtClass::newWorkRemind($shopExt, $order);
+
             echo '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';
         } catch (\Exception $e) {
             $transaction->rollBack();

+ 6 - 4
biz/shop/classes/ShopExtClass.php

@@ -76,10 +76,12 @@ class ShopExtClass extends BaseClass
             if (isset($order->shopAdminId) == false || empty($order->shopAdminId)) {
                 $lbSn = $order->fromType == 4 ? $shopExt->mtLbSn : $shopExt->makeLbSn;
                 $lbVersion = $order->fromType == 4 ? $shopExt->mtLbVersion : $shopExt->makeLbVersion;
-                $sound = "您有新订单,没有生成制作单";
-                $url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version={$lbVersion}&message=" . $sound;
-                $curl = new curl\Curl();
-                $curl->get($url);
+                if (!empty($lbSn)) {
+                    $sound = "您有新订单,没有生成制作单";
+                    $url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version={$lbVersion}&message=" . $sound;
+                    $curl = new curl\Curl();
+                    $curl->get($url);
+                }
             }
         } else {
             //散花