优化:Give_Gift 表查询处理

This commit is contained in:
2026-01-13 09:38:47 +08:00
parent a42ae7a94f
commit 8ef22d87a2
4 changed files with 78 additions and 76 deletions

View File

@@ -72,9 +72,9 @@ class Room extends Model
*/
public function getRoomFlow($room_id,$stime='',$etime=''){
$give_where = [];
$give_where['from_id'] = $room_id;
$give_where['room_id'] = $room_id;
// $give_where['from'] = ["in",[2,3,6]];
$give_where['from'] = 2;
// $give_where['from'] = 2;
if(!empty($stime)){
$give_where['createtime'] = ['>=',strtotime($stime)];
}
@@ -85,8 +85,8 @@ class Room extends Model
// $give_where['createtime'] = ['between',[strtotime($stime),strtotime($etime)]];
$give_where['createtime'] = [['>=',strtotime($stime)],['<',strtotime($etime)]];
}
$total_price = db::name('vs_give_gift')->where($give_where)
->sum('total_price');
$total_price = db::name('vs_guild_flow')->where($give_where)
->sum('flow_price');
return $total_price;
}