From 08a1821b2670bd61cdb60d078e80600336579eb5 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Sat, 3 Feb 2024 16:34:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A8=8B=E5=BA=8F=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E3=80=91=E4=BC=98=E5=8C=96=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/adminapi/controller/v1/marketing/live/LiveGoods.php | 5 +++++ crmeb/app/listener/order/OrderShippingListener.php | 4 ++-- crmeb/crmeb/services/CacheService.php | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/marketing/live/LiveGoods.php b/crmeb/app/adminapi/controller/v1/marketing/live/LiveGoods.php index 587b16131..f83b06c2c 100644 --- a/crmeb/app/adminapi/controller/v1/marketing/live/LiveGoods.php +++ b/crmeb/app/adminapi/controller/v1/marketing/live/LiveGoods.php @@ -72,9 +72,14 @@ class LiveGoods extends AuthController [$goods_info] = $this->request->postMore([ ['goods_info', []] ], true); + $error = false; foreach ($goods_info as $goods) { $this->validate($goods, \app\adminapi\validate\marketing\LiveGoodsValidate::class, 'save'); + if (!preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $goods['image']) && strpos(strtolower($goods['image']), "phar://") !== false) { + $error = true; + } } + if ($error) return app('json')->fail(40137); $this->services->add($goods_info); return app('json')->success(100000); } diff --git a/crmeb/app/listener/order/OrderShippingListener.php b/crmeb/app/listener/order/OrderShippingListener.php index 288f9b0a3..8f1810491 100644 --- a/crmeb/app/listener/order/OrderShippingListener.php +++ b/crmeb/app/listener/order/OrderShippingListener.php @@ -48,7 +48,7 @@ class OrderShippingListener implements ListenerInterface return; } } else if ($order_type == 'recharge') { // 充值订单 - if ($order['recharge_type'] == 'weixin') { + if ($order['recharge_type'] == 'routine') { $delivery_type = 3; $item_desc = '用户充值' . $order['price']; $out_trade_no = $order['order_id']; @@ -59,7 +59,7 @@ class OrderShippingListener implements ListenerInterface return; } } else if ($order_type == 'member') { // 会员订单 - if ($order['pay_type'] == 'weixin') { + if ($order['pay_type'] == 'routine') { $delivery_type = 3; $item_desc = '用户购买' . $order['member_type'] . '会员卡'; $out_trade_no = $order['order_id']; diff --git a/crmeb/crmeb/services/CacheService.php b/crmeb/crmeb/services/CacheService.php index 8511cf916..2afe42375 100644 --- a/crmeb/crmeb/services/CacheService.php +++ b/crmeb/crmeb/services/CacheService.php @@ -39,6 +39,7 @@ class CacheService try { return Cache::tag($tag)->set($name, $value, $expire); } catch (\Throwable $e) { + crmebLog('写入缓存错误:' . $e->getMessage()); return false; } }