提交代码
This commit is contained in:
parent
b4af8c3116
commit
9a2891e1e4
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,10 +42,11 @@
|
|||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>用户信息</th>
|
||||
<th>余额</th>
|
||||
<th>吧唧币</th>
|
||||
<th>积分</th>
|
||||
<th>钻石</th>
|
||||
<th>UU币</th>
|
||||
<th>达达卷</th>
|
||||
<th>佣金</th>
|
||||
<th>状态</th>
|
||||
<th>时间</th>
|
||||
|
|
@ -53,8 +54,9 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{volist name="list" id="vo"}
|
||||
{volist name="list" id="vo" key="index"}
|
||||
<tr>
|
||||
<td>{$start_index + $index}</td>
|
||||
<td style="text-align: left">
|
||||
<div style="display: flex;">
|
||||
<div><img src="{:imageUrl($vo['headimg'])}" alt="" width="50px" height="50px"></div>
|
||||
|
|
@ -73,7 +75,7 @@
|
|||
<td>{$vo['integral']}
|
||||
<!-- <br/><a style="text-decoration:none" name="{$vo.nickname}" onClick="chongzhi({$vo.id},this.name,2,'吧唧币')"class="layui-btn layui-btn-danger layui-btn-xs">充值</a>-->
|
||||
</td>
|
||||
<td>{$vo['score']}
|
||||
<td>{$vo['money2']}
|
||||
<!-- <br/><a style="text-decoration:none" name="{$vo.nickname}" onClick="chongzhi({$vo.id},this.name,3,'积分')"class="layui-btn layui-btn-danger layui-btn-xs">充值</a>-->
|
||||
</td>
|
||||
<td>{$vo['total']}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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("操作失败");
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user