2025-08-16 19:10:54 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
|
|
use app\common\controller\BaseCom;
|
2025-08-18 19:15:06 +08:00
|
|
|
use think\Controller;
|
|
|
|
|
use think\Db;
|
2025-08-16 19:10:54 +08:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 盲盒转盘
|
|
|
|
|
* 2025-08-16
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class BlindBoxTurntable extends BaseCom
|
|
|
|
|
{
|
2025-08-18 19:15:06 +08:00
|
|
|
protected function initialize()
|
|
|
|
|
{
|
|
|
|
|
//允许跨域
|
|
|
|
|
header('Access-Control-Allow-Origin: *');
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-16 19:10:54 +08:00
|
|
|
/*
|
|
|
|
|
* 获取活动奖池礼物列表
|
|
|
|
|
*/
|
|
|
|
|
public function get_gift_list(){
|
|
|
|
|
$gift_bag_id = input('gift_bag_id',0);
|
2025-08-25 19:31:12 +08:00
|
|
|
$room_id = input('room_id',0);
|
|
|
|
|
$reslut = model('BlindBoxTurntableGift')->get_gift_list($gift_bag_id,$room_id);
|
2025-08-16 19:10:54 +08:00
|
|
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
}
|
2025-08-18 19:15:06 +08:00
|
|
|
/*
|
|
|
|
|
* 抽奖
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public function draw_gift(){
|
|
|
|
|
$gift_bag_id = input('gift_bag_id',0);
|
|
|
|
|
$user_id = $this->uid;
|
|
|
|
|
$room_id = input('room_id',0);
|
|
|
|
|
$gift_user_ids = input('gift_user_ids',0);
|
|
|
|
|
$num = input('num',1);
|
2025-09-10 16:35:06 +08:00
|
|
|
$heart_id = input('heart_id',0);
|
2025-10-12 15:47:40 +08:00
|
|
|
$auction_id = input('auction_id',0);
|
2025-10-13 11:26:30 +08:00
|
|
|
$reslut = model('BlindBoxTurntableGiftDrawWorld')->draw_gift($gift_bag_id, $user_id, $gift_user_ids,$num,$room_id,$heart_id,$auction_id);
|
2025-08-18 19:15:06 +08:00
|
|
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* 礼物发放
|
|
|
|
|
*/
|
|
|
|
|
public function gift_send(){
|
2025-09-19 16:44:26 +08:00
|
|
|
// $key_name = "api:blind_box_turntable:gift_send:" . $this->uid;
|
|
|
|
|
// redis_lock_exit($key_name);
|
2025-08-18 19:15:06 +08:00
|
|
|
$send_id = input('send_id',0);
|
|
|
|
|
$reslut = model('BlindBoxTurntableGift')->gift_send($send_id);
|
2025-09-19 16:44:26 +08:00
|
|
|
// redis_unlock($key_name);
|
2025-08-18 19:15:06 +08:00
|
|
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
}
|
2025-08-19 18:09:48 +08:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 获取我的抽奖记录
|
|
|
|
|
*/
|
|
|
|
|
public function get_my_record(){
|
|
|
|
|
$user_id = $this->uid;
|
|
|
|
|
$gift_bag_id = input('gift_bag_id',0);
|
|
|
|
|
$page = input('page',1);
|
|
|
|
|
$page_size = input('page_size',12);
|
|
|
|
|
$reslut = model('BlindBoxTurntableGift')->get_user_record($gift_bag_id,$user_id,$page,$page_size);
|
|
|
|
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 获取全服抽奖记录
|
|
|
|
|
*/
|
|
|
|
|
public function get_all_record(){
|
|
|
|
|
$gift_bag_id = input('gift_bag_id',0);
|
|
|
|
|
$page = input('page',1);
|
|
|
|
|
$page_size = input('page_size',12);
|
|
|
|
|
$reslut = model('BlindBoxTurntableGift')->get_all_record($gift_bag_id,$page,$page_size);
|
|
|
|
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
}
|
2025-08-26 16:19:26 +08:00
|
|
|
/*
|
|
|
|
|
* 巡乐会
|
|
|
|
|
*/
|
|
|
|
|
public function xlh(){
|
|
|
|
|
$room_id = input('room_id',0);
|
|
|
|
|
$reslut = model('BlindBoxTurntableGift')->xlh_gift_list($room_id);
|
|
|
|
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 巡乐会抽奖
|
|
|
|
|
*/
|
|
|
|
|
public function xlh_draw_gift(){
|
|
|
|
|
$user_id = $this->uid;
|
|
|
|
|
$room_id = input('room_id',0);
|
|
|
|
|
$num = input('num',1);
|
2025-10-13 11:26:30 +08:00
|
|
|
$reslut = model('BlindBoxTurntableGiftDrawWorld')->xlh_draw_gift($user_id,$num,$room_id);
|
2025-08-26 16:19:26 +08:00
|
|
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
}
|
2025-08-28 18:44:56 +08:00
|
|
|
/*
|
|
|
|
|
* 获取我的巡乐会记录
|
|
|
|
|
*/
|
|
|
|
|
public function get_xlh_my_record(){
|
|
|
|
|
$page = input('page',1);
|
|
|
|
|
$page_size = input('page_size',12);
|
|
|
|
|
$user_id = $this->uid;
|
|
|
|
|
$room_id = input('room_id',0);
|
|
|
|
|
$reslut = model('BlindBoxTurntableGift')->xlh_get_user_record($user_id,$room_id,$page,$page_size);
|
|
|
|
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* 获取全服巡乐会记录(榜单)
|
|
|
|
|
*/
|
|
|
|
|
public function get_xlh_all_record(){
|
|
|
|
|
$page = input('page',1);
|
|
|
|
|
$page_size = input('page_size',12);
|
|
|
|
|
$room_id = input('room_id',0);
|
|
|
|
|
$reslut = model('BlindBoxTurntableGift')->xlh_ranking($room_id,$page,$page_size);
|
|
|
|
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
}
|
2025-09-26 17:06:48 +08:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 巡乐会榜单 (以期数显示)
|
|
|
|
|
*/
|
|
|
|
|
public function get_xlh_ranking(){
|
|
|
|
|
$page = input('page',1);
|
|
|
|
|
$page_size = input('page_size',12);
|
|
|
|
|
$room_id = input('room_id',0);
|
|
|
|
|
$reslut = model('BlindBoxTurntableGift')->xlh_ranking_list($room_id,$page,$page_size);
|
|
|
|
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
}
|
2025-08-16 19:10:54 +08:00
|
|
|
}
|