房间排行榜
This commit is contained in:
@@ -161,10 +161,12 @@ class Ranking extends Model
|
|||||||
//房间榜
|
//房间榜
|
||||||
public function room_ranking()
|
public function room_ranking()
|
||||||
{
|
{
|
||||||
|
//金币与魅力比例
|
||||||
|
$ratio = get_system_config_value('coin_charm_exp');
|
||||||
$where['a.createtime'] = ['between', [$this->begin_time, $this->end_time]];
|
$where['a.createtime'] = ['between', [$this->begin_time, $this->end_time]];
|
||||||
$where['b.type_id'] = ['<>', 6];
|
$where['b.type_id'] = ['<>', 6];
|
||||||
$where['b.room_status'] = 1;
|
$where['b.room_status'] = 1;
|
||||||
$field = ['sum(a.total_price) as total,b.room_name,a.from_id as room_id,b.room_cover,b.room_number'];
|
$field = ['sum(a.total_price) *'.$ratio.' as total,b.room_name,a.from_id as room_id,b.room_cover,b.room_number'];
|
||||||
$lists = db::name('vs_give_gift')->alias('a')
|
$lists = db::name('vs_give_gift')->alias('a')
|
||||||
->join('vs_room b','a.from_id = b.id','left')
|
->join('vs_room b','a.from_id = b.id','left')
|
||||||
->where($where)->field($field)->group('a.from_id')
|
->where($where)->field($field)->group('a.from_id')
|
||||||
|
|||||||
Reference in New Issue
Block a user