巡乐会抽奖接口提交.-后台列表修改

This commit is contained in:
2025-08-29 17:00:22 +08:00
parent 7edce6b414
commit 4fae9e86b7
2 changed files with 10 additions and 11 deletions

View File

@@ -726,20 +726,21 @@ class BlindBox extends adminApi
$room_id = input('room_id', '');
$periods = input('periods', '');
$where = [];
$where['room_id'] = $room_id;
$where['b.room_id'] = $room_id;
if($gift_id){
$where['gift_id'] = $gift_id;
$where['b.gift_id'] = $gift_id;
}
if($user_id){
$user_id = db::name('user')->where('user_code', $user_id)->value('id');
$where['user_id'] = $user_id;
$where['b.user_id'] = $user_id;
}
if($periods){
$where['periods'] = $periods;
$where['b.periods'] = $periods;
}
$count = db::name('vs_room_pan_xlh_log')
->alias('a')
->join('vs_room_pan_xlh b', 'a.xlh_id = b.id', 'left')
->join('user c', 'a.user_id = c.id', 'left')
->where($where)->count();
$lists_data = db::name('vs_room_pan_xlh_log')

View File

@@ -46,14 +46,9 @@ class Gift extends Model
if($room_id){
$is_open_blind_box_turntable = Db::name('vs_room')->where(['id'=>$room_id])->value('is_open_blind_box_turntable');
}
if($is_open_blind_box_turntable==1){
$activities_id = [4,5];
}else{
$activities_id = [4];
}
foreach ($list as &$v) {
//获取盲盒列表
$box_list = Db::name('vs_gift_bag')->where(['status'=>1])->where(['activities_id'=>["in",$activities_id]])->select();
$box_list = Db::name('vs_gift_bag')->where(['status'=>1])->where(['activities_id'=>["in",[4,5]]])->select();
foreach ($box_list as $key =>$box) {
$ext = json_decode($box['ext'],true);
if ($ext['gift_id'] == $v['gift_id']) {
@@ -65,8 +60,11 @@ class Gift extends Model
break;
}
}
if($is_open_blind_box_turntable==1){
$list_data[] = $v;
}
}
return ['code' => 1, 'msg' => '获取成功', 'data' => $list];
}
return ['code' => 1, 'msg' => '获取成功', 'data' => $list_data];
}
}