Explorar o código

零交会有新人报名

shish %!s(int64=3) %!d(string=hai) anos
pai
achega
0e57c852ce
Modificáronse 1 ficheiros con 15 adicións e 3 borrados
  1. 15 3
      app-hd/controllers/NoticeController.php

+ 15 - 3
app-hd/controllers/NoticeController.php

@@ -54,11 +54,17 @@ class NoticeController extends PublicController
             payUtil::thirdPay($wxPay, $capitalType, $orderSn, $totalFee, $attach, $transactionId);
             $transaction->commit();
             echo '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';
+
             //解决重复通知
-            $cacheKey = 'hd_shop_cg_pay_' . $orderSn;
+            $cacheKey = 'pay_success_notice_' . $orderSn;
             $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
-            if (empty($has)) {
-                Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 864000, 'has']);
+            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)) {
                     //微信通知
@@ -81,6 +87,12 @@ class NoticeController extends PublicController
                     }
                 }
             }
+
+            //零交会购票成功通知
+            if ($capitalType == dict::getDict('capitalType', 'ljhApply', 'id')) {
+                noticeUtil::push("零交会有新人报名,请注意查看", '15280215347');
+            }
+
         } catch (\Exception $e) {
             $transaction->rollBack();
             Yii::error("失败原因:" . $e->getMessage());