|
|
@@ -5,6 +5,7 @@ namespace mall\controllers;
|
|
|
use biz\shop\classes\ShopClass;
|
|
|
use biz\wx\classes\WxMessageClass;
|
|
|
use bizHd\order\classes\OrderClass;
|
|
|
+use bizHd\order\classes\ScanPayClass;
|
|
|
use bizHd\refund\classes\HdRefundClass;
|
|
|
use bizHd\wx\classes\WxOpenClass;
|
|
|
use common\components\noticeUtil;
|
|
|
@@ -180,6 +181,15 @@ class NoticeController extends PublicController
|
|
|
ShopExtClass::newWorkRemind($shopExt, $order);
|
|
|
}
|
|
|
}
|
|
|
+ if ($capitalType == dict::getDict('capitalType', 'scanPay', 'id')) {
|
|
|
+ $myKey = 'mall_order_scan_pay_' . $orderSn;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$myKey]);
|
|
|
+ if (empty($has)) {
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$myKey, 864000, 'has']);
|
|
|
+ $scan = ScanPayClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
+ ShopExtClass::hdScanPayReport($scan);
|
|
|
+ }
|
|
|
+ }
|
|
|
} catch (\Exception $e) {
|
|
|
$transaction->rollBack();
|
|
|
Yii::error("失败原因:" . $e->getMessage());
|
|
|
@@ -455,23 +465,41 @@ class NoticeController extends PublicController
|
|
|
payUtil::thirdPay($payWayType, $capitalType, $orderSn, $totalFee, $attach, $transactionId);
|
|
|
$transaction->commit();
|
|
|
|
|
|
- //打印小票和语音播报
|
|
|
- $order = OrderClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
- if (!empty($order)) {
|
|
|
- $order->thirdLogNo = $thirdLogNo;
|
|
|
- $order->save();
|
|
|
- ShopExtClass::hdGatheringReport($order);
|
|
|
- OrderClass::onlinePrint($order);
|
|
|
-
|
|
|
- $shopId = $order->shopId ?? 0;
|
|
|
- $shop = ShopClass::getById($shopId, true);
|
|
|
- if (in_array($order->fromType, [dict::getDict("fromType", "shop"), dict::getDict("fromType", "friend")])) {
|
|
|
- //您有新的收入提醒
|
|
|
- WxMessageClass::gatheringIncomeInform($shop, $order);
|
|
|
+ if ($capitalType == dict::getDict('capitalType', 'xhOrder', 'id')) {
|
|
|
+ //避免重复
|
|
|
+ $cacheKey = 'mall_order_pay_' . $orderSn;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (empty($has)) {
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 864000, 'has']);
|
|
|
+ //打印小票和语音播报
|
|
|
+ $order = OrderClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
+ if (!empty($order)) {
|
|
|
+ $order->thirdLogNo = $thirdLogNo;
|
|
|
+ $order->save();
|
|
|
+ ShopExtClass::hdGatheringReport($order);
|
|
|
+ OrderClass::onlinePrint($order);
|
|
|
+
|
|
|
+ $shopId = $order->shopId ?? 0;
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ if (in_array($order->fromType, [dict::getDict("fromType", "shop"), dict::getDict("fromType", "friend")])) {
|
|
|
+ //您有新的收入提醒
|
|
|
+ WxMessageClass::gatheringIncomeInform($shop, $order);
|
|
|
+ }
|
|
|
+ if ($order->fromType == dict::getDict("fromType", "mall")) {
|
|
|
+ //来自商城的新订单微信通知
|
|
|
+ WxMessageClass::hdNewOrderInform($shop, $order);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- if ($order->fromType == dict::getDict("fromType", "mall")) {
|
|
|
- //来自商城的新订单微信通知
|
|
|
- WxMessageClass::hdNewOrderInform($shop, $order);
|
|
|
+ }
|
|
|
+ if ($capitalType == dict::getDict('capitalType', 'scanPay', 'id')) {
|
|
|
+ //避免重复
|
|
|
+ $myKey = 'mall_order_scan_pay_' . $orderSn;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$myKey]);
|
|
|
+ if (empty($has)) {
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$myKey, 864000, 'has']);
|
|
|
+ $scan = ScanPayClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
+ ShopExtClass::hdScanPayReport($scan);
|
|
|
}
|
|
|
}
|
|
|
}
|