送礼盲盒点亮
This commit is contained in:
@@ -1880,10 +1880,10 @@ class Room extends Model
|
|||||||
|
|
||||||
if($type == 1){//1财富榜,2魅力榜
|
if($type == 1){//1财富榜,2魅力榜
|
||||||
$res = model('api/GiveGiftBases')->getRoomGiftRanking($params, $type);
|
$res = model('api/GiveGiftBases')->getRoomGiftRanking($params, $type);
|
||||||
$list = $res['data'];
|
$list = $res;
|
||||||
}else{
|
}else{
|
||||||
$res = model('api/GiveGiftBases')->getRoomGiftRanking($params, $type);
|
$res = model('api/GiveGiftBases')->getRoomGiftRanking($params, $type);
|
||||||
$list = $res['data'];
|
$list = $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($list)){
|
if(isset($list)){
|
||||||
|
|||||||
@@ -300,6 +300,25 @@ class SendGift extends Model
|
|||||||
|
|
||||||
//开出的礼物价值
|
//开出的礼物价值
|
||||||
$receive_gift_total += $gift_box[$i]['gift_price'];
|
$receive_gift_total += $gift_box[$i]['gift_price'];
|
||||||
|
|
||||||
|
//使用收礼用户 和礼物ID 查询礼物墙
|
||||||
|
$gift_wall = db::name('user_gift_wall')->where(['user_id'=>$to_uid,'gift_id'=>$gift_id])->find();
|
||||||
|
if($gift_wall){
|
||||||
|
db::name('user_gift_wall')->where(['id'=>$gift_wall['id']])->inc('count',1)->update();
|
||||||
|
$userIds = explode(',',$gift_wall['give_user_ids']);
|
||||||
|
if(!in_array($uid,$userIds)){
|
||||||
|
$userIds[] = $uid;
|
||||||
|
db::name('user_gift_wall')->where(['id'=>$gift_wall['id']])->update(['give_user_ids'=>implode(',',$userIds)]);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
db::name('user_gift_wall')->insert([
|
||||||
|
'user_id' => $to_uid,
|
||||||
|
'gift_id' => $gift_id,
|
||||||
|
'count' => 1,
|
||||||
|
'give_user_ids' => $uid,
|
||||||
|
'updatetime' => time()
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!empty($gift_box_map)){
|
if(!empty($gift_box_map)){
|
||||||
//拼接礼物字符串 (娃哈哈 * 2 / 娃哈哈1 * 1)这种格式
|
//拼接礼物字符串 (娃哈哈 * 2 / 娃哈哈1 * 1)这种格式
|
||||||
@@ -832,6 +851,25 @@ class SendGift extends Model
|
|||||||
'count' => 1
|
'count' => 1
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//使用收礼用户 和礼物ID 查询礼物墙
|
||||||
|
$gift_wall = db::name('user_gift_wall')->where(['user_id'=>$to_uid,'gift_id'=>$gift_id])->find();
|
||||||
|
if($gift_wall){
|
||||||
|
db::name('user_gift_wall')->where(['id'=>$gift_wall['id']])->inc('count',1)->update();
|
||||||
|
$userIds = explode(',',$gift_wall['give_user_ids']);
|
||||||
|
if(!in_array($uid,$userIds)){
|
||||||
|
$userIds[] = $uid;
|
||||||
|
db::name('user_gift_wall')->where(['id'=>$gift_wall['id']])->update(['give_user_ids'=>implode(',',$userIds)]);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
db::name('user_gift_wall')->insert([
|
||||||
|
'user_id' => $to_uid,
|
||||||
|
'gift_id' => $gift_id,
|
||||||
|
'count' => 1,
|
||||||
|
'give_user_ids' => $uid,
|
||||||
|
'updatetime' => time()
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!empty($gift_box_map)){
|
if(!empty($gift_box_map)){
|
||||||
//拼接礼物字符串 (娃哈哈 * 2 / 娃哈哈1 * 1)这种格式
|
//拼接礼物字符串 (娃哈哈 * 2 / 娃哈哈1 * 1)这种格式
|
||||||
|
|||||||
Reference in New Issue
Block a user