Commit 02440ae7 authored by houyadong's avatar houyadong

成员交易逻辑修改-bug

parent a6a70efe
......@@ -249,8 +249,8 @@ class UserModel extends Model
$entrust_where['userid'] = ['in',array_keys($top_uid)];
}
#取委托总条数和页数
$today_count = $model->table($table_name)->where($entrust_where)->count();
$his_count = $today_count + $model->table($his_table_name)->where($entrust_where)->count();
$today_count = $model->table($table_name)->where($entrust_where)->cache(true,3600)->count();
$his_count = $today_count + $model->table($his_table_name)->where($entrust_where)->cache(true,3600)->count();
$today_max_page = ceil($today_count / $pageSize);
if($p <= $today_max_page){
$today_list = $model->table($table_name)
......@@ -261,14 +261,19 @@ class UserModel extends Model
->select();
}
#计算偏移量,根据页码去当日数据表取或归档数据表取数据
if($his_count >= $pageSize * 20){
$his_max_page = 20;
$his_count = 20 * $pageSize;
}else{
$his_max_page = ceil($his_count / $pageSize);
}
if($p >= $today_max_page){
$his_max_page = $his_count >= $pageSize * 20 ? 20 : ceil($his_count / $pageSize);
$p = $p > ($today_max_page + $his_max_page) ? ($today_max_page + $his_max_page) : $p;
if($his_count > 0){
$his_list = $model->table($his_table_name)
->where($entrust_where)
->order('cj_time desc')
->page(($p - $his_max_page < 0 ? 1 : $p - $his_max_page),$pageSize)
->page(($p - $today_max_page < 0 ? 1 : $p - $today_max_page),$pageSize)
->select();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment