巡乐会抽奖接口提交.-错误调试
This commit is contained in:
@@ -80,26 +80,6 @@ class BlindBoxTurntableGift extends Model
|
||||
$bag_gift = db::name("vs_gift")->where(['gid'=>$ext['gift_id']])->find();// 获取盲盒信息
|
||||
$toarray = explode(',',$gift_user_ids);
|
||||
$room = db::name('vs_room')->field('id,xlh_periods,xlh_periods_num,is_open_blind_box_turntable,blind_box_turntable_periods')->where(['id'=>$room_id])->find();
|
||||
//巡乐会
|
||||
$is_xlh = 0;
|
||||
$xlh_box = db::name('vs_gift_bag')->where('id',13)->find();
|
||||
$xlh_ext = json_decode($xlh_box['ext'],true);
|
||||
$xlh = [];
|
||||
if($xlh_ext['inlet_bag_id'] == $bag_data['id']){
|
||||
$is_xlh = 1;
|
||||
$xlh['waiting_start_num'] = $xlh_ext['open_condition']['waiting_start_num'];//等待开奖次数
|
||||
$xlh['start_num'] = $xlh_ext['open_condition']['start_num'];//开始开奖次数
|
||||
//当前抽奖次数
|
||||
$xlh['current_num'] = $room['xlh_periods_num'];
|
||||
//状态
|
||||
if($xlh['current_num'] >= $xlh_ext['open_condition']['start_num']){
|
||||
$xlh['status'] = 1;//状态 1:巡乐会开始 2:即将开始开始 0:等待开始
|
||||
} elseif($xlh['current_num'] >= $xlh_ext['open_condition']['waiting_start_num'] && $xlh['current_num'] < $xlh_ext['open_condition']['start_num']){
|
||||
$xlh['status'] = 2;//状态 1:巡乐会开始 2:即将开始开始 0:等待开始
|
||||
}else{
|
||||
$xlh['status'] = 0;
|
||||
}
|
||||
}
|
||||
//判断是否有足够的金币
|
||||
$user_waller = db::name('user_wallet')->where(['user_id'=>$user_id])->find();
|
||||
if ($user_waller['coin'] < $bag_gift['gift_price'] * $num) {
|
||||
@@ -163,7 +143,23 @@ class BlindBoxTurntableGift extends Model
|
||||
'createtime' => time()
|
||||
]);
|
||||
}
|
||||
if($is_xlh ==1){
|
||||
//巡乐会
|
||||
$xlh_box = db::name('vs_gift_bag')->where('id',13)->find();
|
||||
$xlh_ext = json_decode($xlh_box['ext'],true);
|
||||
$xlh = [];
|
||||
if($xlh_ext['inlet_bag_id'] == $bag_data['id']){
|
||||
$xlh['waiting_start_num'] = $xlh_ext['open_condition']['waiting_start_num'];//等待开奖次数
|
||||
$xlh['start_num'] = $xlh_ext['open_condition']['start_num'];//开始开奖次数
|
||||
//当前抽奖次数
|
||||
$xlh['current_num'] = db::name('vs_room')->where(['id'=>$room_id])->value('xlh_periods_num');
|
||||
//状态
|
||||
if($xlh['current_num'] >= $xlh_ext['open_condition']['start_num']){
|
||||
$xlh['status'] = 1;//状态 1:巡乐会开始 2:即将开始开始 0:等待开始
|
||||
} elseif($xlh['current_num'] >= $xlh_ext['open_condition']['waiting_start_num'] && $xlh['current_num'] < $xlh_ext['open_condition']['start_num']){
|
||||
$xlh['status'] = 2;//状态 1:巡乐会开始 2:即将开始开始 0:等待开始
|
||||
}else{
|
||||
$xlh['status'] = 0;
|
||||
}
|
||||
//推送
|
||||
$text = [
|
||||
'xlh_data' => $xlh,
|
||||
@@ -172,7 +168,6 @@ class BlindBoxTurntableGift extends Model
|
||||
//聊天室推送系统消息
|
||||
model('Chat')->sendMsg(1056,$room_id,$text);
|
||||
}
|
||||
|
||||
$reslut = [];
|
||||
$reslut['blind_box_turntable_id'] = $box_turntable_log;
|
||||
$reslut['reslut_list'] = array_values($reslut_data);
|
||||
|
||||
Reference in New Issue
Block a user