|
|
@@ -60,19 +60,19 @@ class printUtil
|
|
|
'times' => $this->times//打印次数
|
|
|
);
|
|
|
$client = new \HttpClient(self::IP, self::PORT);
|
|
|
- //if (!$client->post(self::PATH, $msgInfo)) {
|
|
|
+ if (!$client->post(self::PATH, $msgInfo)) {
|
|
|
//echo 'error';
|
|
|
- //} else {
|
|
|
+ } else {
|
|
|
//服务器返回的JSON字符串,建议要当做日志记录起来
|
|
|
$result = $client->getContent();
|
|
|
Yii::info('打印日志:' . $result);
|
|
|
$arr = json_decode($result, true);
|
|
|
- //if (isset($arr['ret']) && $arr['ret'] == 1001) {
|
|
|
+ if (isset($arr['ret']) && $arr['ret'] == 1001) {
|
|
|
$msg = $arr['msg'] ?? '';
|
|
|
$sjName = $shop->merchantName ?? '';
|
|
|
$mainId = $shop->mainId ?? 0;
|
|
|
$shopName = $shop->shopName ?? '';
|
|
|
- noticeUtil::push($sjName . $shopName . "出现订单打印未成功{$orderSn},报错内容:" . $msg, '15280215347');
|
|
|
+ noticeUtil::push($sjName . $shopName . " 出现订单打印未成功{$orderSn},报错内容:" . $msg, '15280215347');
|
|
|
$staffList = ShopAdminClass::getAllByCondition(['mainId' => $mainId], null, '*', null, true);
|
|
|
if (!empty($staffList)) {
|
|
|
foreach ($staffList as $staff) {
|
|
|
@@ -86,8 +86,8 @@ class printUtil
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //}
|
|
|
- //}
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function signature($time)
|