|
|
@@ -284,7 +284,7 @@ class OrderController extends BaseController
|
|
|
WxMessageClass::gatheringIncomeInform($shop, $newOrder);
|
|
|
|
|
|
util::success(['returnStatus' => 'SUCCESS']);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
util::complete('没有付款');
|
|
|
}
|
|
|
} else {
|
|
|
@@ -360,15 +360,20 @@ class OrderController extends BaseController
|
|
|
payUtil::thirdPay($wxPayWay, $capitalType, $orderSn, $totalFee, $attach, $transactionId);
|
|
|
$transaction->commit();
|
|
|
|
|
|
- $newOrder = OrderClass::getById($id, true);
|
|
|
- //打印小票
|
|
|
- OrderClass::onlinePrint($newOrder);
|
|
|
- //语音播报
|
|
|
- ShopExtClass::hdGatheringReport($newOrder);
|
|
|
-
|
|
|
- $shopId = $newOrder->shopId ?? 0;
|
|
|
- $shop = ShopClass::getById($shopId, true);
|
|
|
- WxMessageClass::gatheringIncomeInform($shop, $newOrder);
|
|
|
+ //解决重复通知
|
|
|
+ $cacheKey = 'shop_order_pay_' . $orderSn;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (empty($has)) {
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 100, 'has']);
|
|
|
+ $newOrder = OrderClass::getById($id, true);
|
|
|
+ //打印小票
|
|
|
+ OrderClass::onlinePrint($newOrder);
|
|
|
+ //语音播报
|
|
|
+ ShopExtClass::hdGatheringReport($newOrder);
|
|
|
+ $shopId = $newOrder->shopId ?? 0;
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ WxMessageClass::gatheringIncomeInform($shop, $newOrder);
|
|
|
+ }
|
|
|
|
|
|
util::success(['returnStatus' => 'SUCCESS']);
|
|
|
} else {
|
|
|
@@ -449,15 +454,22 @@ class OrderController extends BaseController
|
|
|
payUtil::thirdPay($aliPayWay, $capitalType, $orderSn, $totalFee, $attach, $transactionId);
|
|
|
$transaction->commit();
|
|
|
|
|
|
- $newOrder = OrderClass::getById($id, true);
|
|
|
- //打印小票
|
|
|
- OrderClass::onlinePrint($newOrder);
|
|
|
- //语音播报
|
|
|
- ShopExtClass::hdGatheringReport($newOrder);
|
|
|
+ //解决重复通知
|
|
|
+ $cacheKey = 'shop_order_pay_' . $orderSn;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (empty($has)) {
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 100, 'has']);
|
|
|
|
|
|
- $shopId = $newOrder->shopId ?? 0;
|
|
|
- $shop = ShopClass::getById($shopId, true);
|
|
|
- WxMessageClass::gatheringIncomeInform($shop, $newOrder);
|
|
|
+ $newOrder = OrderClass::getById($id, true);
|
|
|
+ //打印小票
|
|
|
+ OrderClass::onlinePrint($newOrder);
|
|
|
+ //语音播报
|
|
|
+ ShopExtClass::hdGatheringReport($newOrder);
|
|
|
+
|
|
|
+ $shopId = $newOrder->shopId ?? 0;
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ WxMessageClass::gatheringIncomeInform($shop, $newOrder);
|
|
|
+ }
|
|
|
|
|
|
util::success(['returnStatus' => 'SUCCESS']);
|
|
|
}
|