【程序目录】优化缓存

This commit is contained in:
evoxwht 2024-02-03 16:34:53 +08:00
parent 814a161487
commit 08a1821b26
3 changed files with 8 additions and 2 deletions

View File

@ -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);
}

View File

@ -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'];

View File

@ -39,6 +39,7 @@ class CacheService
try {
return Cache::tag($tag)->set($name, $value, $expire);
} catch (\Throwable $e) {
crmebLog('写入缓存错误:' . $e->getMessage());
return false;
}
}