|
|
@@ -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)
|