加幸运币统计字段
This commit is contained in:
@@ -91,6 +91,8 @@ class Guild extends adminApi
|
||||
$list[$k]['updatetime'] = date('Y-m-d H:i:s',$v['updatetime']);
|
||||
$list[$k]['user_id'] = $user['user_code']??"";
|
||||
$list[$k]['intro'] = $v['intro'];
|
||||
//幸运币流水
|
||||
$list[$k]['lucky_coin'] = model('Guild')->getTodayMoneyLuckyCoin($v['id'],$search_stime,$search_etime);
|
||||
}
|
||||
// 数组按today_money 排序
|
||||
usort($list, function($a, $b) {
|
||||
@@ -507,10 +509,10 @@ class Guild extends adminApi
|
||||
$search_stime = $search_stime_str;
|
||||
$search_etime = $search_etime_str;
|
||||
if($search_stime!=""){
|
||||
if($search_stime!="" && $v['createtime'] < strtotime($search_stime)){
|
||||
if($search_stime!="" && $v['apply_time'] < strtotime($search_stime)){
|
||||
$search_stime = $search_stime;
|
||||
}else{
|
||||
$search_stime = date('Y-m-d H:i:s',$v['createtime']) ;
|
||||
$search_stime = date('Y-m-d H:i:s',$v['apply_time']) ;
|
||||
}
|
||||
}else{
|
||||
$search_stime = $search_stime;
|
||||
@@ -539,17 +541,40 @@ class Guild extends adminApi
|
||||
$rum_lists[$k]['consumption']= model('Room')->getRoomFlow($v['room_id'],$search_stime,$search_etime);
|
||||
$rum_lists[$k]['add_time'] = date('Y-m-d H:i:s',$v['createtime']);
|
||||
$total_consumption += $rum_lists[$k]['consumption'];
|
||||
//幸运币统计
|
||||
if($search_stime !== ''){
|
||||
$where_lucky['createtime'] = ['>=', strtotime($search_stime)];
|
||||
}
|
||||
if($search_etime !== ''){
|
||||
$where_lucky['createtime'] = ['<=', strtotime($search_etime)];
|
||||
}
|
||||
if(!empty($search_stime) && !empty($search_etime)){
|
||||
$where_lucky['createtime'] = ['between',[strtotime($search_stime),strtotime($search_etime)]];
|
||||
}
|
||||
$rum_lists[$k]['lucky_coin'] = db::name('vs_room_luck_value')->where('room_id',$room_id)->where($where_lucky)->sum('luck_value');
|
||||
}
|
||||
usort($rum_lists, function($a, $b) {
|
||||
return $b['consumption'] - $a['consumption'];
|
||||
});
|
||||
//分页
|
||||
$rum_lists = array_slice($rum_lists, ($page-1)*$page_limit, $page_limit);
|
||||
//幸运币统计
|
||||
|
||||
$where_lucky = [];
|
||||
if($search_stime !== ''){
|
||||
$where_lucky['createtime'] = ['>=', strtotime($search_stime)];
|
||||
}
|
||||
if($search_etime !== ''){
|
||||
$where_lucky['createtime'] = ['<=', strtotime($search_etime)];
|
||||
}
|
||||
if(!empty($search_stime) && !empty($search_etime)){
|
||||
$where_lucky['createtime'] = ['between',[strtotime($search_stime),strtotime($search_etime)]];
|
||||
}
|
||||
$return_data = [
|
||||
'page' =>$page,
|
||||
'page_limit' => $page_limit,
|
||||
'total_consumption' => $total_consumption,
|
||||
'total_lucky_coin' => db::name('vs_room_luck_value')->where($where_lucky)->sum('luck_value'),
|
||||
'count' => $count,
|
||||
'lists' => $rum_lists
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user