秘地bug修改-盲盒转盘
This commit is contained in:
@@ -54,7 +54,7 @@ class Decorate extends adminApi
|
||||
$return_list[$k]['type_str'] = model('api/Decorate')->TypeArray[$v['type']];
|
||||
$return_list[$k]['base_image'] = $v['base_image'];
|
||||
$return_list[$k]['file_type'] = $v['file_type'];
|
||||
$return_list[$k]['file_type_str'] = $v['file_type'] ? "SVGA" : "MP4";
|
||||
$return_list[$k]['file_type_str'] = $v['file_type']==1 ? "SVGA" : "MP4";
|
||||
$return_list[$k]['play_image'] = $v['play_image'];
|
||||
$return_list[$k]['show_status'] = $v['show_status'];
|
||||
$return_list[$k]['is_buy'] = $v['is_buy'];
|
||||
|
||||
@@ -291,6 +291,12 @@ class BlindBoxTurntableGift extends Model
|
||||
$gift_bag_detail = $result['gift_bag_detail'];
|
||||
$gift = $result['gift'];
|
||||
|
||||
$pan_data = db::name("vs_room_pan")
|
||||
->where(['room_id'=>$room_id,'gift_bag_detail_id'=>$gift_bag_detail['id']])->value("remaining_number");
|
||||
if($pan_data < 1){
|
||||
db::rollback();
|
||||
return ['code' => 0, 'msg' => '礼物数量不足', 'data' => null];
|
||||
}
|
||||
// 构造返回数据
|
||||
$result_data = [
|
||||
'user_id' => $user_id,
|
||||
@@ -345,7 +351,7 @@ class BlindBoxTurntableGift extends Model
|
||||
|
||||
// 减去盲盒包礼物数量
|
||||
$ret = db::name("vs_room_pan")
|
||||
->where(['room_id'=>$room_id,'gift_bag_detail_id'=>$gift_bag_detail['id']])
|
||||
->where(['room_id'=>$room_id,'gift_bag_detail_id'=>$gift_bag_detail['id'],"remaining_number"=>["<>",0]])
|
||||
->setDec('remaining_number',1);
|
||||
|
||||
if(!$ret){
|
||||
@@ -355,10 +361,10 @@ class BlindBoxTurntableGift extends Model
|
||||
}
|
||||
|
||||
// 处理奖池重置操作
|
||||
if ($should_reset_all_gifts) {
|
||||
// 重置奖池中所有礼物数量
|
||||
$this->reset_gift_pool($room_id, $gift_bag_id, $current_periods);
|
||||
}
|
||||
// if ($should_reset_all_gifts) {
|
||||
// // 重置奖池中所有礼物数量
|
||||
// $this->reset_gift_pool($room_id, $gift_bag_id, $current_periods);
|
||||
// }
|
||||
|
||||
// 批量插入盲盒转盘结果记录
|
||||
foreach ($gift_user_counts as $user_gift) {
|
||||
|
||||
@@ -29,7 +29,7 @@ class RoomPan
|
||||
* 盲盒转盘礼物补发
|
||||
*/
|
||||
public function blind_box_turntable_gift_send(){
|
||||
$blind_box_turntable_log = db('vs_blind_box_turntable_results_log')->where(['is_sued'=>0,'createtime'=>['>=',time()-60*30]])->select();
|
||||
$blind_box_turntable_log = db('vs_blind_box_turntable_results_log')->where(['is_sued'=>0,'createtime'=>['>=',time()-60*30]])->limit(50)->select();
|
||||
if(empty($blind_box_turntable_log)){
|
||||
echo "没有需要发放的礼物 \n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user