From 2219f2cdfcdd9b8f55a64a556585c0fdeed75bdd Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 9 Mar 2022 09:03:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E8=AE=A2=E5=8D=95=E5=90=8E?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v1/order/StoreOrderController.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index 48e200c6f..4756651f2 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -393,26 +393,27 @@ class StoreOrderController if ($order['pink_id'] && $services->isPinkStatus($order['pink_id'])) { return app('json')->fail('该订单已失效!'); } - if (!Cache::get('pay_' . $order['order_id'])) { + $isChannel = $this->getChennel[$from]; + //缓存不存在 || 切换另一端支付 + if (!Cache::get('pay_' . $order['order_id']) || $isChannel != $order['is_channel']) { switch ($from) { case 'weixin': - if ($type == 1) { - $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id']; - } elseif (in_array($order->is_channel, [1, 2, 3])) {//0 + if ($type == 1 || in_array($order['is_channel'], [1, 2, 3, 4])) {//0 $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id']; } break; case 'weixinh5': - if ($type == 1) { - $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id']; - } elseif (in_array($order->is_channel, [0, 1, 3])) { + if ($type == 1 || in_array($order['is_channel'], [0, 1, 3, 4])) { $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id']; } break; case 'routine': - if ($type == 1) { + if ($type == 1 || in_array($order['is_channel'], [0, 2, 3, 4])) { $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id']; - } elseif (in_array($order->is_channel, [0, 2, 3])) { + } + break; + case 'app': + if ($type == 1 || in_array($order['is_channel'], [0, 1, 2, 3])) { $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id']; } break;