盲盒转盘bug修改 后台统计修改
This commit is contained in:
@@ -769,19 +769,24 @@ class BlindBox extends adminApi
|
||||
if($room){
|
||||
$lists[$key]['room_name'] = $room['room_number']."-".$room['room_name'];
|
||||
}
|
||||
$lists[$key]['bag_price'] = $value['bag_price'];
|
||||
$lists[$key]['bag_price'] = $value['bag_price']*$value['num'];
|
||||
$lists[$key]['gift_id'] = $value['gift_id'];
|
||||
$lists[$key]['gift_name'] = db::name('vs_gift')->where('gid',$value['gift_id'])->value('gift_name');
|
||||
$lists[$key]['gift_price'] = $value['gift_price'];
|
||||
$lists[$key]['gift_num'] = $value['num'];
|
||||
$lists[$key]['createtime'] = date('Y-m-d H:i:s',$value['createtime']);
|
||||
}
|
||||
//总抽奖次数
|
||||
$total = $count;
|
||||
$all_lists_data = db::name('vs_gift_bag_receive_log')->where($where)->order("id desc")->select();
|
||||
$total =0;
|
||||
$total_gift_money = 0;
|
||||
foreach ($all_lists_data as $key => $value) {
|
||||
$total += $value['num'];
|
||||
$total_gift_money += $value['gift_price'] * $value['num'];
|
||||
}
|
||||
//总抽奖次数 $total
|
||||
//总抽奖金额(支出)
|
||||
$total_money = db::name('vs_gift_bag_receive_log')->where($where)->sum('bag_price');
|
||||
//总礼物价值(收入)
|
||||
$total_gift_money = db::name('vs_gift_bag_receive_log')->where($where)->sum('gift_price');
|
||||
//总礼物价值(收入) $total_gift_money
|
||||
//统计
|
||||
if($total_gift_money==0 || $total_money==0){
|
||||
$ratio = 0;
|
||||
@@ -863,12 +868,14 @@ class BlindBox extends adminApi
|
||||
$lists[$key]['createtime'] = date('Y-m-d H:i:s',$value['createtime']);
|
||||
}
|
||||
//今日锁定礼物数量
|
||||
$today = strtotime(date('Y-m-d'));
|
||||
$locking_num = db::name('vs_room_pan_xlh_log')->where('createtime','>=',$today)->count();
|
||||
$return_data = [
|
||||
'page' =>$page,
|
||||
'page_limit' => $page_limit,
|
||||
'count' => count($lists_data),
|
||||
'count' => $count,
|
||||
'lists' => $lists,
|
||||
'locking_num' => $count
|
||||
'locking_num' => $locking_num
|
||||
];
|
||||
return V(1,"成功", $return_data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user