| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace bizHd\shop\classes;
- use biz\shop\classes\ShopClass;
- use biz\sj\classes\SjClass;
- use common\components\printUtil;
- use common\components\util;
- use Yii;
- use bizHd\base\classes\BaseClass;
- class ShopExtClass extends BaseClass
- {
- public static $baseFile = '\bizHd\shop\models\ShopExt';
- //订单取消前三分钟打印通知商家 ssh 20250221
- public static function beforeCancelPrint($shopId, $order)
- {
- $shop = ShopClass::getById($shopId, true);
- $orderSn = $order->orderSn ?? '';
- $actPrice = $order->actPrice ?? 0;
- $addTime = $order->addTime??'';
- $addDate = date('m-d H:i', strtotime($addTime));
- $sjId = $shop->sjId ?? 0;
- $sj = SjClass::getById($sjId, true);
- $sjName = $sj->name ?? '';
- $shopName = $shop->shopName ?? '';
- $currentName = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName;
- $content = "<CB>" . $currentName . "</CB><BR><BR>";
- $content .= '<AUDIO-CANCEL>';
- $content .= "<CB>订单即将取消</CB><BR>";
- $content .= '--------------------------------<BR>';
- $content .= '<CB>订单号</CB><BR>';
- $content .= '<CB>' . $orderSn . '</CB><BR>';
- $content .= "<CB>订单金额</CB><BR>";
- $content .= "<CB>{$actPrice}</CB><BR>";
- $content .= "<CB>订单时间</CB><BR>";
- $content .= "<CB>{$addDate}</CB><BR>";
- $content .= '--------------------------------<BR>';
- $content .= '<CB>买家信息</CB><BR>';
- $content .= '<CB>' . $order->customName . '</CB><BR>';
- $content .= '<CB>' . $order->customMobile . '</CB><BR>';
- $content .= '--------------------------------<BR>';
- $content .= "<BR>";
- $content .= "<BR>";
- $content .= "<CB>此单客户下单10分钟未付款,稍后将自动取消,如有需要,请跟客户电话确认是否还要</CB><BR>";
- $content .= "<BR>";
- $content .= "<CB>注意不是客户主动申请取消!!!因小票机提示音无法修改,所以说是客户申请取消</CB><BR>";
- $ext = self::getByCondition(['shopId' => $shopId]);
- $printSn = $ext['printSn'] ?? '';
- if (!empty($printSn)) {
- $p = new printUtil($printSn);
- $p->printMsg($content, $shop, $orderSn);
- }
- }
- }
|