|
|
@@ -116,26 +116,33 @@ class NoticeController extends PublicController
|
|
|
payUtil::thirdPay($wxPay, $capitalType, $orderSn, $totalFee, $attach, $transactionId);
|
|
|
$transaction->commit();
|
|
|
|
|
|
- //打印小票和语音播报
|
|
|
- $order = OrderClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
- ShopExtClass::hdGatheringReport($order);
|
|
|
- OrderClass::onlinePrint($order);
|
|
|
+ echo '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';
|
|
|
|
|
|
- $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);
|
|
|
- }
|
|
|
+ //解决重复通知
|
|
|
+ $cacheKey = 'mall_order_pay_' . $orderSn;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (empty($has)) {
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 300, 'has']);
|
|
|
|
|
|
- $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);
|
|
|
- ShopExtClass::newWorkRemind($shopExt, $order);
|
|
|
+ //打印小票和语音播报
|
|
|
+ $order = OrderClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
+ ShopExtClass::hdGatheringReport($order);
|
|
|
+ OrderClass::onlinePrint($order);
|
|
|
|
|
|
- echo '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';
|
|
|
+ $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);
|
|
|
+ }
|
|
|
+
|
|
|
+ $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);
|
|
|
+ ShopExtClass::newWorkRemind($shopExt, $order);
|
|
|
+ }
|
|
|
} catch (\Exception $e) {
|
|
|
$transaction->rollBack();
|
|
|
Yii::error("失败原因:" . $e->getMessage());
|
|
|
@@ -150,7 +157,7 @@ class NoticeController extends PublicController
|
|
|
//商户订单号
|
|
|
$orderSn = $_POST['out_trade_no'];
|
|
|
|
|
|
- $order = OrderClass::getByCondition(['orderSn'=>$orderSn], true);
|
|
|
+ $order = OrderClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
|
|
|
$aliPId = '2021003122664465';
|
|
|
$aliKey = 'MIIEpAIBAAKCAQEAnefrChYa5FUbGTlZNMTDNG531WrVP+TBPw3/hSmycRlBE/1sg9EryM0S3a9OQKQenRdYOoalqkkBuzt41ygJUC5hfNeaiV2OzphIiAyxUaiL1mSftP5B8joBN3HGG2AKbcvKlWcFoeiGY4ZmV/K0t3fqj/uPP6N/pEtnx6X4Ifgz4WGCDKUXKqT1Pyk2rqyIpel2EYk+HtC+9iicfac9kKQQiksDopb7sYosttdk64Dmjp2nMLDSpR+KOZUaqB39MEeHcJGeTzdVrp+Z9wW/NcJzSkSUb9juA0YjmogdbiKltykVHTbP6J0uPyByvzfyyY22QPqwNPiIPbCN6H543QIDAQABAoIBAQCO0+rOecYjSDO1siDVUTC8KTutR+/R1klRjojUWy3zjQNHYJAZ/0ZaX9wzttDSOWETeL0uWwJYL6coQxf/jVA3PWyirqYyn/R/PFFG9iwhj5HE/8lRvjXKMttM2lV2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