盲盒转盘错误修改
This commit is contained in:
@@ -46,7 +46,7 @@ class BlindBoxTurntableGiftDraw extends Model
|
||||
}
|
||||
|
||||
// 2. 预加载必要数据
|
||||
$loadResult = $this->loadDrawData($gift_bag_id, $user_id, $room_id);
|
||||
$loadResult = $this->loadDrawData($gift_bag_id, $user_id, $room_id,$num,$gift_user_ids);
|
||||
if ($loadResult['code'] !== 1) {
|
||||
return $loadResult;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ class BlindBoxTurntableGiftDraw extends Model
|
||||
/**
|
||||
* 预加载必要数据
|
||||
*/
|
||||
private function loadDrawData($gift_bag_id, $user_id, $room_id)
|
||||
private function loadDrawData($gift_bag_id, $user_id, $room_id,$num,$gift_user_ids)
|
||||
{
|
||||
// 1. 合并查询盲盒配置和礼物信息
|
||||
$bag_data = db::name("vs_gift_bag")
|
||||
@@ -183,6 +183,9 @@ class BlindBoxTurntableGiftDraw extends Model
|
||||
if (!$user_waller) {
|
||||
return ['code' => 0, 'msg' => '用户钱包不存在', 'data' => null];
|
||||
}
|
||||
if ($user_waller['coin'] < $bag_data['gift_price'] * $num * count(explode(',', $gift_user_ids))) {
|
||||
return ['code' => 0, 'msg' => '用户金币不足', 'data' => null];
|
||||
}
|
||||
|
||||
// 4. 获取巡乐会配置(使用缓存)
|
||||
$xlh_ext = $this->getCachedXlhConfig();
|
||||
|
||||
Reference in New Issue
Block a user