巡乐会抽奖接口提交.-联调-盘-bug修改
This commit is contained in:
@@ -312,6 +312,7 @@ class BlindBoxTurntableGift extends Model
|
|||||||
'homeowner_gift_id' => $xlh_ext['locking_condition']['give_homeowner_gift_id'],
|
'homeowner_gift_id' => $xlh_ext['locking_condition']['give_homeowner_gift_id'],
|
||||||
'periods' => $room['xlh_periods']+1,
|
'periods' => $room['xlh_periods']+1,
|
||||||
'num' => 0,
|
'num' => 0,
|
||||||
|
'end_time' => time() + $xlh_ext['locking_time']['end_time'] * 60,
|
||||||
'createtime' => time()
|
'createtime' => time()
|
||||||
]);
|
]);
|
||||||
if(!$pan_xlh_id){
|
if(!$pan_xlh_id){
|
||||||
@@ -338,12 +339,15 @@ class BlindBoxTurntableGift extends Model
|
|||||||
if(!$blind_box_turntable){
|
if(!$blind_box_turntable){
|
||||||
return ['code' => 0, 'msg' => '数据不存在','data' => null];
|
return ['code' => 0, 'msg' => '数据不存在','data' => null];
|
||||||
}
|
}
|
||||||
$blind_box_turntable_log = db('vs_blind_box_turntable_results_log')->where(['tid'=>$send_id,'is_sued'=>0])->select();
|
$blind_box_turntable_log = db('vs_blind_box_turntable_results_log')->where(['tid'=>$send_id])->select();
|
||||||
if(!$blind_box_turntable_log){
|
if(!$blind_box_turntable_log){
|
||||||
return ['code' => 0, 'msg' => '开奖数据不存在','data' => null];
|
return ['code' => 0, 'msg' => '开奖数据不存在','data' => null];
|
||||||
}
|
}
|
||||||
//获取盲盒配置
|
//获取盲盒配置
|
||||||
foreach ($blind_box_turntable_log as $key => $value) {
|
foreach ($blind_box_turntable_log as $key => $value) {
|
||||||
|
if($value['is_sued'] == 1){ //礼物已发放就不再重复发放
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$give_gift_ext['gift_id'] = $value['gift_id'];
|
$give_gift_ext['gift_id'] = $value['gift_id'];
|
||||||
$give_gift_ext['count'] = $value['count'];
|
$give_gift_ext['count'] = $value['count'];
|
||||||
$give_gift_ext['gift_price'] = $value['gift_price'];
|
$give_gift_ext['gift_price'] = $value['gift_price'];
|
||||||
@@ -434,8 +438,6 @@ class BlindBoxTurntableGift extends Model
|
|||||||
if(empty($pan_xlh)){
|
if(empty($pan_xlh)){
|
||||||
return ['code' => 0, 'msg' => '未开始', 'data' => null];
|
return ['code' => 0, 'msg' => '未开始', 'data' => null];
|
||||||
}
|
}
|
||||||
//巡乐会结束时间
|
|
||||||
$xlh_end_time = $pan_xlh['createtime'] + $xlh_ext['locking_time']['end_time'] * 60;
|
|
||||||
$xlh_user_data= null;
|
$xlh_user_data= null;
|
||||||
if($pan_xlh['user_id']){
|
if($pan_xlh['user_id']){
|
||||||
$xlh_user = db::name('user')->where('id',$pan_xlh['user_id'])->find();
|
$xlh_user = db::name('user')->where('id',$pan_xlh['user_id'])->find();
|
||||||
@@ -444,14 +446,12 @@ class BlindBoxTurntableGift extends Model
|
|||||||
'nickname' => $xlh_user['nickname'],
|
'nickname' => $xlh_user['nickname'],
|
||||||
'avatar' => $xlh_user['avatar'],
|
'avatar' => $xlh_user['avatar'],
|
||||||
];
|
];
|
||||||
//寻乐会结束时间
|
|
||||||
$xlh_end_time = $pan_xlh['end_time'];
|
|
||||||
}
|
}
|
||||||
$result_data = [
|
$result_data = [
|
||||||
'title' => $xlh_box['name'],
|
'title' => $xlh_box['name'],
|
||||||
'rule_url' => get_system_config_value('web_site')."/api/Page/get_gift_box_rule?box_id=".$xlh_box["id"],
|
'rule_url' => get_system_config_value('web_site')."/api/Page/get_gift_box_rule?box_id=".$xlh_box["id"],
|
||||||
'box_price' => $xlh_ext['xlh_box_price'],
|
'box_price' => $xlh_ext['xlh_box_price'],
|
||||||
'xlh_end_time' =>$xlh_end_time,
|
'xlh_end_time' =>$pan_xlh['end_time'],
|
||||||
'give_homeowner_gift' => [
|
'give_homeowner_gift' => [
|
||||||
'gift_id' => $room_user_gift['gid'],
|
'gift_id' => $room_user_gift['gid'],
|
||||||
'gift_name' => $room_user_gift['gift_name'],
|
'gift_name' => $room_user_gift['gift_name'],
|
||||||
@@ -492,6 +492,12 @@ class BlindBoxTurntableGift extends Model
|
|||||||
if(empty($pan_xlh)){
|
if(empty($pan_xlh)){
|
||||||
return ['code' => 0, 'msg' => '未开始', 'data' => null];
|
return ['code' => 0, 'msg' => '未开始', 'data' => null];
|
||||||
}
|
}
|
||||||
|
if($pan_xlh['end_time']<=time()){
|
||||||
|
return ['code' => 0, 'msg' => '本轮已结束', 'data' => null];
|
||||||
|
}
|
||||||
|
if($pan_xlh['send_time']!=0){
|
||||||
|
return ['code' => 0, 'msg' => '本轮已结束,礼物已发放', 'data' => null];
|
||||||
|
}
|
||||||
$is_zhong_jiang = 0;
|
$is_zhong_jiang = 0;
|
||||||
$pan_xlh_num = $pan_xlh['num'];
|
$pan_xlh_num = $pan_xlh['num'];
|
||||||
//奖池总的抽奖次数
|
//奖池总的抽奖次数
|
||||||
|
|||||||
@@ -61,12 +61,12 @@ class Gift extends Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($list as $k=>$v) {
|
foreach ($list as $gift) {
|
||||||
if($is_open_blind_box_turntable == 1){
|
if($is_open_blind_box_turntable == 1){
|
||||||
$list_data[] = $v;
|
$list_data[] = $gift;
|
||||||
}else{
|
}else{
|
||||||
if(isset($v['activities_id']) && $v['activities_id'] == 4){
|
if(isset($gift['activities_id']) && $gift['activities_id'] == 4){
|
||||||
$list_data[] = $v;
|
$list_data[] = $gift;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,12 +56,31 @@ class RoomPan
|
|||||||
* 巡乐会结束 礼物发放 【定时脚本】
|
* 巡乐会结束 礼物发放 【定时脚本】
|
||||||
*/
|
*/
|
||||||
public function xlh_gift_send(){
|
public function xlh_gift_send(){
|
||||||
$xlh_list = db::name('vs_room_pan_xlh')->where(['send_time'=>0,'user_id'=>['neq',0],'end_time'=>['<',time()]])->select();
|
$xlh_list = db::name('vs_room_pan_xlh')->where(['send_time'=>0,'end_time'=>['<',time()]])->select();
|
||||||
if(empty($xlh_list)){
|
if(empty($xlh_list)){
|
||||||
echo "没有需要发放的礼物 \n";
|
echo "没有需要发放的礼物 \n";
|
||||||
}
|
}
|
||||||
foreach ($xlh_list as $key=>$value){
|
foreach ($xlh_list as $key=>$value){
|
||||||
try{
|
try{
|
||||||
|
if($value['user_id'] == 0){
|
||||||
|
echo "第.".$value['periods']." 巡乐会结束 没有中奖用户 \n";
|
||||||
|
$res = db::name('vs_room_pan_xlh')->where('id',$value['id'])->update([
|
||||||
|
'send_time' => time()
|
||||||
|
]);
|
||||||
|
db::name("vs_room")->where('id',$value['room_id'])->update([
|
||||||
|
'xlh_periods_num' => 0
|
||||||
|
]);
|
||||||
|
//推送礼物横幅
|
||||||
|
$text = "本轮巡乐会已结束,请大家重新开始下一轮巡乐会";
|
||||||
|
$push = new Push(0, $value['room_id']);
|
||||||
|
$text_list_new = [
|
||||||
|
'text' => $text,
|
||||||
|
'room_id' => $value['room_id'],
|
||||||
|
'from_type' => 3
|
||||||
|
];
|
||||||
|
$push->xunlehui($text_list_new);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//发放
|
//发放
|
||||||
//抽中礼物落包
|
//抽中礼物落包
|
||||||
$res = [];
|
$res = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user