巡乐会抽奖接口提交.-heart_id 天津
This commit is contained in:
@@ -38,7 +38,8 @@ class BlindBoxTurntable extends BaseCom
|
|||||||
$room_id = input('room_id',0);
|
$room_id = input('room_id',0);
|
||||||
$gift_user_ids = input('gift_user_ids',0);
|
$gift_user_ids = input('gift_user_ids',0);
|
||||||
$num = input('num',1);
|
$num = input('num',1);
|
||||||
$reslut = model('BlindBoxTurntableGift')->draw_gift($gift_bag_id, $user_id, $gift_user_ids,$num,$room_id);
|
$heart_id = input('heart_id',0);
|
||||||
|
$reslut = model('BlindBoxTurntableGift')->draw_gift($gift_bag_id, $user_id, $gift_user_ids,$num,$room_id,$heart_id);
|
||||||
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class BlindBoxTurntableGift extends Model
|
|||||||
/*
|
/*
|
||||||
* 抽奖
|
* 抽奖
|
||||||
*/
|
*/
|
||||||
public function draw_gift($gift_bag_id, $user_id, $gift_user_ids,$num=1,$room_id=0){
|
public function draw_gift($gift_bag_id, $user_id, $gift_user_ids,$num=1,$room_id=0,$heart_id=0){
|
||||||
//获取盲盒配置
|
//获取盲盒配置
|
||||||
$bag_data = db::name("vs_gift_bag")->field('id,name,ext,periods')->where('id',$gift_bag_id)->find();
|
$bag_data = db::name("vs_gift_bag")->field('id,name,ext,periods')->where('id',$gift_bag_id)->find();
|
||||||
$ext = json_decode($bag_data['ext'],true);
|
$ext = json_decode($bag_data['ext'],true);
|
||||||
@@ -157,7 +157,8 @@ class BlindBoxTurntableGift extends Model
|
|||||||
'count' => $value['count'],
|
'count' => $value['count'],
|
||||||
'gift_price' => $value['gift_price'],
|
'gift_price' => $value['gift_price'],
|
||||||
'all_gift_price' => $value['gift_price'] * $value['count'],
|
'all_gift_price' => $value['gift_price'] * $value['count'],
|
||||||
'createtime' => time()
|
'createtime' => time(),
|
||||||
|
'heart_id' => $heart_id
|
||||||
]);
|
]);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
db::rollback();
|
db::rollback();
|
||||||
@@ -376,7 +377,8 @@ class BlindBoxTurntableGift extends Model
|
|||||||
$give_gift_ext['gift_price'] = $value['gift_price'];
|
$give_gift_ext['gift_price'] = $value['gift_price'];
|
||||||
$give_gift_ext['all_gift_price'] = $value['all_gift_price'];
|
$give_gift_ext['all_gift_price'] = $value['all_gift_price'];
|
||||||
$give_gift_ext['is_draw_gift'] = 1;
|
$give_gift_ext['is_draw_gift'] = 1;
|
||||||
$res = model('GiveGift')->give_gift($blind_box_turntable['user_id'], $value['gift_user_id'], $value['gift_id'], $value['count'],2,1, $blind_box_turntable['room_id'],0,0,$give_gift_ext);
|
// $res = model('GiveGift')->give_gift($blind_box_turntable['user_id'], $value['gift_user_id'], $value['gift_id'], $value['count'],2,1, $blind_box_turntable['room_id'],0,0,$give_gift_ext);
|
||||||
|
$res = model('Room')->room_gift($blind_box_turntable['user_id'], $value['gift_user_id'], $value['gift_id'], $value['count'], 2, $blind_box_turntable['room_id'], 0,$value['heart_id'],$give_gift_ext);
|
||||||
if (isset($res) && $res['code'] != 1) {
|
if (isset($res) && $res['code'] != 1) {
|
||||||
// return V(0, $res['msg']);
|
// return V(0, $res['msg']);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -282,9 +282,9 @@ class Friend extends Model
|
|||||||
* @param $room_id 房间id
|
* @param $room_id 房间id
|
||||||
* @param $pit_number 坑位
|
* @param $pit_number 坑位
|
||||||
*/
|
*/
|
||||||
public function room_give_gift($uid, $to_uid, $gift_id, $gift_num, $from_type, $type, $room_id, $pit_number, $heart_id)
|
public function room_give_gift($uid, $to_uid, $gift_id, $gift_num, $from_type, $type, $room_id, $pit_number, $heart_id,$give_gift_ext)
|
||||||
{
|
{
|
||||||
$res = model('GiveGift')->give_gift($uid, $to_uid, $gift_id, $gift_num, $from_type, $type, $room_id, $pit_number);
|
$res = model('GiveGift')->give_gift($uid, $to_uid, $gift_id, $gift_num, $from_type, $type, $room_id, $pit_number,$give_gift_ext);
|
||||||
if($res['code'] != 1){
|
if($res['code'] != 1){
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1248,7 +1248,7 @@ class Room extends Model
|
|||||||
|
|
||||||
|
|
||||||
//房间送礼
|
//房间送礼
|
||||||
public function room_gift($uid, $to_uid, $gift_id, $gift_num,$type, $room_id, $pit_number, $heart_id)
|
public function room_gift($uid, $to_uid, $gift_id, $gift_num,$type, $room_id, $pit_number, $heart_id,$give_gift_ext="")
|
||||||
{
|
{
|
||||||
$label_type = model('Room')->get_room_label($room_id);
|
$label_type = model('Room')->get_room_label($room_id);
|
||||||
if($label_type['code'] != 1){
|
if($label_type['code'] != 1){
|
||||||
@@ -1281,11 +1281,11 @@ class Room extends Model
|
|||||||
}
|
}
|
||||||
return $res;
|
return $res;
|
||||||
}elseif($label_type['data']['type_id'] == 6){
|
}elseif($label_type['data']['type_id'] == 6){
|
||||||
return model('GiveGift')->give_gift($uid, $to_uid, $gift_id, $gift_num,6,$type, $room_id,$pit_number);
|
return model('GiveGift')->give_gift($uid, $to_uid, $gift_id, $gift_num,6,$type, $room_id,$pit_number,$give_gift_ext);
|
||||||
}elseif($label_type['data']['type_id'] == 7){
|
}elseif($label_type['data']['type_id'] == 7){
|
||||||
return model('Friend')->room_give_gift($uid, $to_uid, $gift_id, $gift_num,2,$type, $room_id,$pit_number,$heart_id);
|
return model('Friend')->room_give_gift($uid, $to_uid, $gift_id, $gift_num,2,$type, $room_id,$pit_number,$heart_id,$give_gift_ext);
|
||||||
}else{
|
}else{
|
||||||
$res = model('GiveGift')->give_gift($uid, $to_uid, $gift_id, $gift_num,2,$type, $room_id,$pit_number);
|
$res = model('GiveGift')->give_gift($uid, $to_uid, $gift_id, $gift_num,2,$type, $room_id,$pit_number,$give_gift_ext);
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ class RoomPan
|
|||||||
$give_gift_ext['all_gift_price'] = $value['all_gift_price'];
|
$give_gift_ext['all_gift_price'] = $value['all_gift_price'];
|
||||||
$give_gift_ext['is_draw_gift'] = 1;
|
$give_gift_ext['is_draw_gift'] = 1;
|
||||||
echo "发放Id:".$value['id']." 补发用户Id:".$value['gift_user_id']." 礼物Id:".$value['gift_id']." 礼物数量:".$value['count']."\n";
|
echo "发放Id:".$value['id']." 补发用户Id:".$value['gift_user_id']." 礼物Id:".$value['gift_id']." 礼物数量:".$value['count']."\n";
|
||||||
$res = model('GiveGift')->give_gift($blind_box_turntable['user_id'], $value['gift_user_id'], $value['gift_id'], $value['count'],2,1, $blind_box_turntable['room_id'],0,0,$give_gift_ext);
|
// $res = model('GiveGift')->give_gift($blind_box_turntable['user_id'], $value['gift_user_id'], $value['gift_id'], $value['count'],2,1, $blind_box_turntable['room_id'],0,0,$give_gift_ext);
|
||||||
|
$res = model('Room')->room_gift($blind_box_turntable['user_id'], $value['gift_user_id'], $value['gift_id'], $value['count'], 2, $blind_box_turntable['room_id'], 0,$value['heart_id'],$give_gift_ext);
|
||||||
if (isset($res) && $res['code'] != 1) {
|
if (isset($res) && $res['code'] != 1) {
|
||||||
echo "礼物发放失败".$res['msg']."\n";
|
echo "礼物发放失败".$res['msg']."\n";
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user