酒吧房:->相关接口提交-bug修改
This commit is contained in:
@@ -988,6 +988,9 @@ class Room extends adminApi
|
||||
];
|
||||
model('api/Chat')->sendMsg(1012,$room_id,$text);
|
||||
}
|
||||
if($type_id == 9){
|
||||
$data['label_id'] = 6;
|
||||
}
|
||||
$data['updatetime'] = time();
|
||||
$res = db::name('vs_room')->where('id',$room_id)->update($data);
|
||||
if($res){
|
||||
|
||||
@@ -711,33 +711,45 @@ class Statistical extends adminApi
|
||||
if($search_gift_bag_id > 0){
|
||||
$where['a.gift_bag_id'] = $search_gift_bag_id;
|
||||
}
|
||||
if(!empty($etime) && $etime<="1767038400"){//2025-12-30 04:00:00
|
||||
if(!empty($etime) && strtotime($etime)<="1767038400"){//2025-12-30 04:00:00
|
||||
$tasks_bag_details = db::name('vs_gift_bag_receive_log')
|
||||
->alias('a')
|
||||
->join('vs_gift_bag_detail b', 'a.parent_id=b.id')
|
||||
->join('vs_gift_bag_detail b', 'a.parent_id=b.id', 'INNER')
|
||||
->field('a.createtime,b.type,b.foreign_id,b.quantity,b.gold')
|
||||
->where(['b.type'=>['in', [1,2]]])
|
||||
->where('a.gift_bag_id','>=',18)
|
||||
->where('a.gift_bag_id','<=',51)
|
||||
->whereBetween('a.gift_bag_id', [18, 51])
|
||||
->where($where)
|
||||
->select();
|
||||
}else{
|
||||
$tasks_bag_details = db::name('vs_gift_bag_receive_tasks_log')
|
||||
->alias('a')
|
||||
->join('vs_gift_bag_detail b', 'a.parent_id=b.id')
|
||||
->join('vs_gift_bag_detail b', 'a.parent_id=b.id', 'INNER')
|
||||
->field('a.createtime,b.type,b.foreign_id,b.quantity,b.gold')
|
||||
->where(['b.type'=>['in', [1,2]]])
|
||||
->where('a.gift_bag_id','>=',18)
|
||||
->where('a.gift_bag_id','<=',51)
|
||||
->whereBetween('a.gift_bag_id', [18, 51])
|
||||
->where($where)
|
||||
->select();
|
||||
}
|
||||
$total_reward_price = 0;
|
||||
// 批量获取礼物价格以减少数据库查询
|
||||
$gift_ids = [];
|
||||
foreach ($tasks_bag_details as $detail) {
|
||||
if($detail['type'] == 2) {
|
||||
$gift_ids[] = $detail['foreign_id'];
|
||||
}
|
||||
}
|
||||
|
||||
$gift_prices = [];
|
||||
if (!empty($gift_ids)) {
|
||||
$gifts = db::name('vs_gift')->where('gid', 'in', array_unique($gift_ids))->column('gift_price', 'gid');
|
||||
$gift_prices = $gifts ?: [];
|
||||
}
|
||||
|
||||
foreach ($tasks_bag_details as $detail){
|
||||
if($detail['type'] == 1){
|
||||
$total_reward_price += $detail['gold'] * $detail['quantity'];
|
||||
}else{
|
||||
$gift_price = db::name('vs_gift')->where('gid',$detail['foreign_id'])->value('gift_price');
|
||||
$gift_price = isset($gift_prices[$detail['foreign_id']]) ? $gift_prices[$detail['foreign_id']] : 0;
|
||||
$total_reward_price += $gift_price * $detail['quantity'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user