shish 4 years ago
parent
commit
ae67499c01
2 changed files with 18 additions and 5 deletions
  1. 1 4
      app-hd/controllers/WorkController.php
  2. 17 1
      biz/shop/classes/ShopExtClass.php

+ 1 - 4
app-hd/controllers/WorkController.php

@@ -225,10 +225,7 @@ class WorkController extends BaseController
             WorkClass::finish($work);
             $transaction->commit();
 
-            //美团的订单完成时不需要打标签
-            if ($work->fromType != dict::getDict('fromType', 'mt')) {
-                WorkClass::print($work, $this->shop, false);
-            }
+            WorkClass::print($work, $this->shop, false);
 
             util::complete();
         } catch (\Exception $e) {

+ 17 - 1
biz/shop/classes/ShopExtClass.php

@@ -28,7 +28,23 @@ class ShopExtClass extends BaseClass
         if ($alone == 1) {
             $lbSn = $shopExt->mtLbSn ?? '';
         }
-        $sound = "您有新的美团单,下午5点送";
+        $sound = "您有新的美团单";
+        $reachDate = $order->reachDate ?? '';
+        if (!empty($reachDate) && $reachDate != '0000-00-00') {
+
+            $readPeriod = $order->reachPeriod ?? 0;
+            $reachPeriodName = dict::getDict('reachPeriodName');
+            $period = $reachPeriodName[$readPeriod] ?? '上午';
+            if ($reachDate == date("Y-m-d")) {
+                $sound .= '今天' . $period . "送";
+            } elseif ($reachDate == date("Y-m-d", strtotime("+1 day"))) {
+                $sound .= '明天' . $period . "送";
+            } elseif ($reachDate == date("Y-m-d", strtotime("+2 day"))) {
+                $sound .= '后天' . $period . "送";
+            } else {
+                $sound .= date("d", strtotime($reachDate)) . '号' . $period . "送";
+            }
+        }
         $url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version=3&message=" . $sound;
         $curl = new curl\Curl();
         $curl->get($url);