This commit is contained in:
youda 2025-04-19 16:13:32 +08:00
parent f764e69640
commit b28e31e384
4 changed files with 32 additions and 31 deletions

View File

@ -26,7 +26,7 @@ class Config extends Base
return $this->renderSuccess('获取成功', [ return $this->renderSuccess('获取成功', [
'good_type' => $goodsTypeList, 'good_type' => $goodsTypeList,
'app_setting' => $app_setting, 'app_setting' => $app_setting,
'version' => '101' 'version' => '103'
]); ]);
} }

View File

@ -267,7 +267,7 @@ class Goods extends Base
]; ];
// 将结果缓存到Redis设置过期时间为30秒30秒 // 将结果缓存到Redis设置过期时间为30秒30秒
$redis->set($cache_key, json_encode($new_data), 30); $redis->set($cache_key, json_encode($new_data), 10);
return $this->renderSuccess('请求成功', $new_data); return $this->renderSuccess('请求成功', $new_data);
} }

View File

@ -123,10 +123,11 @@ class Infinite extends Base
// 缓存未命中,从数据库获取并缓存 // 缓存未命中,从数据库获取并缓存
if ($join_count1 === false) { if ($join_count1 === false) {
$join_count1 = OrderList::field('id')->where('goods_id', '=', $goods_id) $join_count1 = OrderList::field('id')
->where('goods_id', '=', $goods_id)
->where('shang_id', 'between', [34, 38]) ->where('shang_id', 'between', [34, 38])
->where('order_type', '=', $goods['type']) // ->where('order_type', '=', $goods['type'])
->where('source', '=', 1) // ->where('source', '=', 1)
->count(); ->count();
// 设置缓存5分钟过期 // 设置缓存5分钟过期
@ -182,7 +183,7 @@ class Infinite extends Base
$value['shang_color'] = $value['shang_info']['color']; $value['shang_color'] = $value['shang_info']['color'];
unset($value['shang_info']); unset($value['shang_info']);
} }
$type1 = 8;
if ($goods['type'] == 2) { if ($goods['type'] == 2) {
$type1 = 8; $type1 = 8;
} elseif ($goods['type'] == 8) { } elseif ($goods['type'] == 8) {
@ -1329,12 +1330,12 @@ class Infinite extends Base
} }
$ling_goods_list1 = GoodsList::field('goods_id,shang_id,title,imgurl') $ling_goods_list1 = GoodsList::field('goods_id,shang_id,title,imgurl')
->append(['shang_info']) ->append(['shang_info'])
->where(['goods_id' => $goods_id]) ->where(['goods_id' => $goods_id])
->where('is_lingzhu', '=', 1) ->where('is_lingzhu', '=', 1)
->where(['num' => 0]) ->where(['num' => 0])
->order('sort desc,shang_id asc,id asc') ->order('sort desc,shang_id asc,id asc')
->select(); ->select();
foreach ($ling_goods_list1 as &$value) { foreach ($ling_goods_list1 as &$value) {
$value['imgurl'] = imageUrl($value['imgurl']); $value['imgurl'] = imageUrl($value['imgurl']);
$ling_goods_list[] = $value; $ling_goods_list[] = $value;

View File

@ -12,7 +12,7 @@ use think\console\Output;
use think\facade\Db; use think\facade\Db;
/** /**
* 更新盒子热度值到Redis命令 * 更新盒子热度值到Redis命令 php think UpdateGoodsHeat
*/ */
class UpdateGoodsHeat extends Command class UpdateGoodsHeat extends Command
{ {