shish 3 yıl önce
ebeveyn
işleme
8467690967

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

@@ -1156,7 +1156,7 @@ class OrderClass extends BaseClass
         $printSn = $ext['printSn'] ?? '';
         if (!empty($printSn)) {
             $p = new printUtil($printSn);
-            $p->printMsg($content);
+            $p->printMsg($content, $shop);
         }
     }
 

+ 24 - 9
common/components/printUtil.php

@@ -2,6 +2,7 @@
 
 namespace common\components;
 
+use biz\shop\classes\ShopAdminClass;
 use Yii;
 use yii\helpers\Json;
 use linslin\yii2\curl;
@@ -46,7 +47,7 @@ class printUtil
         }
     }
 
-    public function printMsg($content)
+    public function printMsg($content, $shop = null)
     {
         $time = time();         //请求时间
         $msgInfo = array(
@@ -61,16 +62,30 @@ class printUtil
         $client = new \HttpClient(self::IP, self::PORT);
         if (!$client->post(self::PATH, $msgInfo)) {
             //echo 'error';
-        } else {
-            //服务器返回的JSON字符串,建议要当做日志记录起来
-            $result = $client->getContent();
-            Yii::info('打印日志:' . $result);
-            $arr = json_decode($result, true);
-            if (isset($arr['ret']) && $arr['ret'] == 1001) {
-                $msg = $arr['msg'] ?? '';
-                noticeUtil::push('有订单打印报错了!!请注意查看,报错内容:' . $msg, '15280215347');
+        }
+        //} else {
+        //服务器返回的JSON字符串,建议要当做日志记录起来
+        $result = $client->getContent();
+        Yii::info('打印日志:' . $result);
+        $arr = json_decode($result, true);
+        if (isset($arr['ret']) && $arr['ret'] == 1001) {
+            $msg = $arr['msg'] ?? '';
+            noticeUtil::push('有订单打印报错了!!请注意查看,报错内容:' . $msg, '15280215347');
+            $mainId = $shop->mainId ?? 0;
+            $staffList = ShopAdminClass::getAllByCondition(['mainId' => $mainId], null, '*', null, true);
+            if (!empty($staffList)) {
+                foreach ($staffList as $staff) {
+                    $remind = $staff->remind ?? 0;
+                    $isPt = $staff->isPt ?? 0;
+                    $delStatus = $staff->delStatus ?? 0;
+                    if ($isPt == 0 && $remind == 1 && $delStatus == 0) {
+                        $mobile = $staff->mobile ?? '';
+                        sms::send($mobile, '请注意,您有一个订单花材很多,小票没有打出来。');
+                    }
+                }
             }
         }
+        //}
     }
 
     public function signature($time)