|
|
@@ -258,9 +258,43 @@ class NoticeController extends PublicController
|
|
|
//支付成功后续流程
|
|
|
payUtil::thirdPay($aliPay, $capitalType, $orderSn, $totalFee, $attach, $tradeNo);
|
|
|
$transaction->commit();
|
|
|
+ //请不要修改
|
|
|
+ echo "success";
|
|
|
+
|
|
|
+ //解决重复通知
|
|
|
+ $cacheKey = 'pay_success_notice_' . $orderSn;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (!empty($has)) {
|
|
|
+ Yii::$app->end();
|
|
|
+ }
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 864000, 'has']);
|
|
|
+
|
|
|
+ //零售采购结账通知
|
|
|
+ if ($capitalType == dict::getDict('capitalType', 'xhPurchase', 'id')) {
|
|
|
+ $cg = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
+ if (!empty($cg) && $cg->payStatus == 1) {
|
|
|
+ //微信通知
|
|
|
+ $saleId = $cg->saleId ?? 0;
|
|
|
+ $order = OrderClass::getById($saleId, true);
|
|
|
+ if (!empty($order)) {
|
|
|
+ //订单生成时唤起在线打印
|
|
|
+ if (isset($order->needPrint) && $order->needPrint == dict::getDict('needPrint', 'need')) {
|
|
|
+ OrderClass::onlinePrint($order);
|
|
|
+ $order->printNum += 1;
|
|
|
+ $order->save();
|
|
|
+ }
|
|
|
+ $shopId = $order->shopId ?? 0;
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ if (!empty($shop)) {
|
|
|
+ WxMessageClass::ghsHasNewOrderInform($shop, $order);
|
|
|
+ }
|
|
|
+ //花店采购供货商端收到通知
|
|
|
+ NoticeClass::ghsNewOrderNotice($order);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- //请不要修改
|
|
|
- echo "success";
|
|
|
} catch (\Exception $e) {
|
|
|
$transaction->rollBack();
|
|
|
Yii::error("失败原因:" . $e->getMessage());
|