|
|
@@ -154,29 +154,31 @@ class NoticeController extends PublicController
|
|
|
echo "SUCCESS";
|
|
|
|
|
|
//解决重复通知
|
|
|
- $cacheKey = 'mall_order_pay_' . $orderSn;
|
|
|
- $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
- if (empty($has)) {
|
|
|
- Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 864000, 'has']);
|
|
|
+ if ($capitalType == dict::getDict('capitalType', 'xhOrder', 'id')) {
|
|
|
+ $cacheKey = 'mall_order_pay_' . $orderSn;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
|
|
|
+ if (empty($has)) {
|
|
|
+ Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 864000, 'has']);
|
|
|
+
|
|
|
+ //打印小票和语音播报
|
|
|
+ $order = OrderClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
+ ShopExtClass::hdGatheringReport($order);
|
|
|
+ OrderClass::onlinePrint($order);
|
|
|
|
|
|
- //打印小票和语音播报
|
|
|
- $order = OrderClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
- ShopExtClass::hdGatheringReport($order);
|
|
|
- OrderClass::onlinePrint($order);
|
|
|
+ $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);
|
|
|
+ }
|
|
|
|
|
|
- $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);
|
|
|
}
|
|
|
-
|
|
|
- $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);
|
|
|
- ShopExtClass::newWorkRemind($shopExt, $order);
|
|
|
}
|
|
|
} catch (\Exception $e) {
|
|
|
$transaction->rollBack();
|