diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index 139bede..01ec1a2 100755 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -722,7 +722,21 @@ class User extends Base // 将UID转换为用户ID $id = $this->convertUidToUserId($id); // dd($id); - $list = \app\common\model\User::where('pid', $id)->paginate(20); + + // 获取当前页码 + $page_num = $request->param('page', 1); + $list_rows = 20; + + // 修复分页:明确指定包含id参数 + $query = ['id' => $id]; // 确保id参数被保留 + $list = \app\common\model\User::where('pid', $id)->paginate([ + 'list_rows' => $list_rows, + 'query' => $query + ]); + + // 计算基础序号 + $start_index = ($page_num - 1) * $list_rows; + $page = $list->render(); $data['list'] = $list->toArray()['data']; $data['count'] = $list->total(); @@ -737,7 +751,8 @@ class User extends Base // dd($data['list']); View::assign('list', $data['list']); View::assign('count', $data['count']); - View::assign('page', $data['page']); + View::assign('page', $page); + View::assign('start_index', $start_index); return View::fetch("User/user_team"); } diff --git a/app/admin/view/User/user_team.html b/app/admin/view/User/user_team.html index 0e4641d..0060c10 100755 --- a/app/admin/view/User/user_team.html +++ b/app/admin/view/User/user_team.html @@ -42,10 +42,11 @@ + - - - + + + @@ -53,8 +54,9 @@ - {volist name="list" id="vo"} + {volist name="list" id="vo" key="index"} + -
序号 用户信息余额吧唧币积分钻石UU币达达卷 佣金 状态 时间
{$start_index + $index}
@@ -73,7 +75,7 @@
{$vo['integral']} {$vo['score']} + {$vo['money2']} {$vo['total']} diff --git a/app/api/controller/FuLiWu.php b/app/api/controller/FuLiWu.php index f5305e8..45ed978 100755 --- a/app/api/controller/FuLiWu.php +++ b/app/api/controller/FuLiWu.php @@ -72,14 +72,13 @@ class FuLiWu extends Base $redis = (new \app\common\server\RedisHelper())->getRedis(); $cacheKey = "order_goods_count:{$itme['id']}"; $join_count = $redis->get($cacheKey); - + // 缓存未命中,从数据库获取并缓存 - if ($join_count === false) { + if ($join_count === false || true) { $join_count = OrderList::field('id') ->where('goods_id', '=', $itme['id']) - ->where('order_type', '=', $itme['type']) ->count(); - + // 设置缓存,5分钟过期 $redis->set($cacheKey, $join_count, 300); } else { diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index 2d008db..0b5ad87 100755 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -1283,7 +1283,18 @@ class Goods extends Base 'addtime' => time(), ]); } + + // 清除相关缓存 if ($res) { + $redis = (new \app\common\server\RedisHelper())->getRedis(); + + + // 清除商品详情缓存 + $redis->del("goods_detail_{$goods_id}_{$user['id']}"); + + // 清除无限抽盒子缓存(如果有) + $redis->del("infinite_goodsdetail_{$goods_id}_{$user['id']}"); + return $this->renderSuccess("操作成功"); } else { return $this->renderError("操作失败"); diff --git a/app/api/controller/Infinite.php b/app/api/controller/Infinite.php index 3b772d5..53d037f 100755 --- a/app/api/controller/Infinite.php +++ b/app/api/controller/Infinite.php @@ -103,10 +103,10 @@ class Infinite extends Base $goods['type_text'] = $goods_type['corner_text']; } #当前热度 - $join_user = OrderList::field('user_id') + $join_user = Order::field('user_id') ->append(['userinfo']) ->where('goods_id', '=', $goods_id) - ->where('order_type', '=', $goods['type']) + // ->where('order_type', '=', $goods['type']) ->order('id desc') ->group('user_id') ->limit(5)