爆币
This commit is contained in:
@@ -34,7 +34,10 @@ class Lottery extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
$nums = $num * count($toarray);
|
$nums = $num * count($toarray);
|
||||||
$this->lottery($send_uid,$gift_info['gift_price'],$nums,$room_id,$gift_id);
|
$ress = $this->lottery($send_uid,$gift_info['gift_price'],$nums,$room_id,$gift_id);
|
||||||
|
if($ress['code'] == 0){
|
||||||
|
return ['code' => 0, 'msg' => $ress['msg'], 'data' => null];
|
||||||
|
}
|
||||||
|
|
||||||
//送礼 开启事务
|
//送礼 开启事务
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
@@ -125,7 +128,7 @@ class Lottery extends Model
|
|||||||
//抽奖
|
//抽奖
|
||||||
public function lottery($send_uid,$gift_price,$num,$room_id,$giftId)
|
public function lottery($send_uid,$gift_price,$num,$room_id,$giftId)
|
||||||
{
|
{
|
||||||
// try {
|
try {
|
||||||
for($i=0;$i<$num;$i++){
|
for($i=0;$i<$num;$i++){
|
||||||
$gift_gold = $gift_price;
|
$gift_gold = $gift_price;
|
||||||
$service = new LotteryService();
|
$service = new LotteryService();
|
||||||
@@ -150,11 +153,11 @@ class Lottery extends Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return V(1, '送礼成功');
|
return ['code' => 1, 'msg' => '送礼成功', 'data' => null];
|
||||||
// } catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
// Log::error('抽奖处理失败:' . $e->getMessage());
|
Log::error('抽奖处理失败:' . $e->getMessage());
|
||||||
// return V(0, $e->getMessage());
|
return ['code' => 0, 'msg' => $e->getMessage(), 'data' => null];
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user