Selaa lähdekoodia

有订单打印报错了

shish 3 vuotta sitten
vanhempi
commit
365f2597f5
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      common/components/printUtil.php

+ 5 - 1
common/components/printUtil.php

@@ -64,8 +64,12 @@ class printUtil
         } else {
             //服务器返回的JSON字符串,建议要当做日志记录起来
             $result = $client->getContent();
-            //echo $result;
             Yii::info('打印日志:' . $result);
+            $arr = json_decode($result, true);
+            if (isset($arr['ret']) && $arr['ret'] == 1001) {
+                $msg = $arr['msg'] ?? '';
+                sms::freeSend(15280215347, '有订单打印报错了,请注意查看,报错内容:' . $msg);
+            }
         }
     }