盲盒转盘bug修改 后台统计修改
This commit is contained in:
@@ -769,19 +769,24 @@ class BlindBox extends adminApi
|
|||||||
if($room){
|
if($room){
|
||||||
$lists[$key]['room_name'] = $room['room_number']."-".$room['room_name'];
|
$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_id'] = $value['gift_id'];
|
||||||
$lists[$key]['gift_name'] = db::name('vs_gift')->where('gid',$value['gift_id'])->value('gift_name');
|
$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_price'] = $value['gift_price'];
|
||||||
$lists[$key]['gift_num'] = $value['num'];
|
$lists[$key]['gift_num'] = $value['num'];
|
||||||
$lists[$key]['createtime'] = date('Y-m-d H:i:s',$value['createtime']);
|
$lists[$key]['createtime'] = date('Y-m-d H:i:s',$value['createtime']);
|
||||||
}
|
}
|
||||||
//总抽奖次数
|
$all_lists_data = db::name('vs_gift_bag_receive_log')->where($where)->order("id desc")->select();
|
||||||
$total = $count;
|
$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_money = db::name('vs_gift_bag_receive_log')->where($where)->sum('bag_price');
|
||||||
//总礼物价值(收入)
|
//总礼物价值(收入) $total_gift_money
|
||||||
$total_gift_money = db::name('vs_gift_bag_receive_log')->where($where)->sum('gift_price');
|
|
||||||
//统计
|
//统计
|
||||||
if($total_gift_money==0 || $total_money==0){
|
if($total_gift_money==0 || $total_money==0){
|
||||||
$ratio = 0;
|
$ratio = 0;
|
||||||
@@ -863,12 +868,14 @@ class BlindBox extends adminApi
|
|||||||
$lists[$key]['createtime'] = date('Y-m-d H:i:s',$value['createtime']);
|
$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 = [
|
$return_data = [
|
||||||
'page' =>$page,
|
'page' =>$page,
|
||||||
'page_limit' => $page_limit,
|
'page_limit' => $page_limit,
|
||||||
'count' => count($lists_data),
|
'count' => $count,
|
||||||
'lists' => $lists,
|
'lists' => $lists,
|
||||||
'locking_num' => $count
|
'locking_num' => $locking_num
|
||||||
];
|
];
|
||||||
return V(1,"成功", $return_data);
|
return V(1,"成功", $return_data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -642,7 +642,10 @@ class BlindBoxTurntableGift extends Model
|
|||||||
$textMessage = $user_nickname;
|
$textMessage = $user_nickname;
|
||||||
$text_message = [];
|
$text_message = [];
|
||||||
foreach ($blind_box_turntable_log as $key => $value) {
|
foreach ($blind_box_turntable_log as $key => $value) {
|
||||||
$ToUserInfo = Db::name('user')->where(['id'=>$value['gift_user_id']])->find();
|
$ToUserInfo = Db::name('user')->where(['id' => $value['gift_user_id']])->field('id as user_id,nickname,avatar,sex')->find();
|
||||||
|
$ToUserInfo['icon'][0] = model('UserData')->user_wealth_icon($value['gift_user_id']);//财富图标
|
||||||
|
$ToUserInfo['icon'][1] = model('UserData')->user_charm_icon($value['gift_user_id']);//魅力图标
|
||||||
|
$ToUserInfo['charm'] = db::name('vs_room_user_charm')->where(['user_id' => $value['gift_user_id'],'room_id' => $room_id])->value('charm');//魅力
|
||||||
$draw_gift = Db::name('vs_gift')->where(['gid'=>$value['gift_id']])->find();
|
$draw_gift = Db::name('vs_gift')->where(['gid'=>$value['gift_id']])->find();
|
||||||
$textMessage = $textMessage . ' 送给 ' . $ToUserInfo['nickname']. ' 盲盒转盘礼物 ' . $draw_gift['gift_name'].' x ' .$value['count']."\n";
|
$textMessage = $textMessage . ' 送给 ' . $ToUserInfo['nickname']. ' 盲盒转盘礼物 ' . $draw_gift['gift_name'].' x ' .$value['count']."\n";
|
||||||
$play_image[] = $draw_gift['play_image'];
|
$play_image[] = $draw_gift['play_image'];
|
||||||
@@ -660,11 +663,15 @@ class BlindBoxTurntableGift extends Model
|
|||||||
'number' => $value['count'],
|
'number' => $value['count'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
$ToUserInfosList[$value['gift_user_id']] = $ToUserInfo;
|
||||||
|
|
||||||
|
}
|
||||||
|
foreach($ToUserInfosList as $userInfo) {
|
||||||
|
$ToUserInfos[] = $userInfo;
|
||||||
}
|
}
|
||||||
$text = [
|
$text = [
|
||||||
'FromUserInfo' => $FromUserInfo,
|
'FromUserInfo' => $FromUserInfo,
|
||||||
|
'ToUserInfos' => $ToUserInfos,
|
||||||
'GiftInfo' => [
|
'GiftInfo' => [
|
||||||
'play_image' => implode(',',$play_image),
|
'play_image' => implode(',',$play_image),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -47,7 +47,10 @@ class RoomPan
|
|||||||
$textMessage = $user_nickname;
|
$textMessage = $user_nickname;
|
||||||
$text_message = $user_nickname;
|
$text_message = $user_nickname;
|
||||||
foreach ($blind_box_turntable_results_log as $key => $value) {
|
foreach ($blind_box_turntable_results_log as $key => $value) {
|
||||||
$ToUserInfo = Db::name('user')->where(['id'=>$value['gift_user_id']])->find();
|
$ToUserInfo = Db::name('user')->where(['id' => $value['gift_user_id']])->field('id as user_id,nickname,avatar,sex')->find();
|
||||||
|
$ToUserInfo['icon'][0] = model('UserData')->user_wealth_icon($value['gift_user_id']);//财富图标
|
||||||
|
$ToUserInfo['icon'][1] = model('UserData')->user_charm_icon($value['gift_user_id']);//魅力图标
|
||||||
|
$ToUserInfo['charm'] = db::name('vs_room_user_charm')->where(['user_id' => $value['gift_user_id'],'room_id' => $room_id])->value('charm');//魅力
|
||||||
$draw_gift = Db::name('vs_gift')->where(['gid'=>$value['gift_id']])->find();
|
$draw_gift = Db::name('vs_gift')->where(['gid'=>$value['gift_id']])->find();
|
||||||
$textMessage = $textMessage . ' 送给 ' . $ToUserInfo['nickname']. ' 盲盒转盘礼物 ' . $draw_gift['gift_name'].' x ' .$value['count']."\n";
|
$textMessage = $textMessage . ' 送给 ' . $ToUserInfo['nickname']. ' 盲盒转盘礼物 ' . $draw_gift['gift_name'].' x ' .$value['count']."\n";
|
||||||
$play_image[] = $draw_gift['play_image'];
|
$play_image[] = $draw_gift['play_image'];
|
||||||
@@ -65,9 +68,14 @@ class RoomPan
|
|||||||
'number' => $value['count'],
|
'number' => $value['count'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
$ToUserInfosList[$value['gift_user_id']] = $ToUserInfo;
|
||||||
|
}
|
||||||
|
foreach($ToUserInfosList as $userInfo) {
|
||||||
|
$ToUserInfos[] = $userInfo;
|
||||||
}
|
}
|
||||||
$text = [
|
$text = [
|
||||||
'FromUserInfo' => $FromUserInfo,
|
'FromUserInfo' => $FromUserInfo,
|
||||||
|
'ToUserInfos' => $ToUserInfos,
|
||||||
'GiftInfo' => [
|
'GiftInfo' => [
|
||||||
'play_image' => implode(',',$play_image),
|
'play_image' => implode(',',$play_image),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user