Jelajahi Sumber

语音播报

shish 1 tahun lalu
induk
melakukan
b0a4f7bb45
1 mengubah file dengan 15 tambahan dan 0 penghapusan
  1. 15 0
      app-hd/controllers/NoticeController.php

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

@@ -493,6 +493,21 @@ class NoticeController extends PublicController
                     }
                 }
             }
+
+            //散客下单买花,回调通知后,播报声音提示,这个方法本来不能写在这边要写在app-mall里的
+            if ($capitalType == dict::getDict('capitalType', 'xhOrder', 'id')) {
+                $cacheKey = 'hd_shop_order_pay_' . $orderSn;
+                $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
+                if (empty($has)) {
+                    Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 300, 'has']);
+                    $newOrder = OrderClass::getByCondition(['orderSn' => $orderSn], true);
+                    if ($newOrder->onlinePay == 2) {
+                        //语音播报
+                        ShopExtClass::hdGatheringReport($newOrder);
+                    }
+                }
+            }
+
         } catch (\Exception $e) {
             $transaction->rollBack();
             Yii::error("失败原因:" . $e->getMessage());