125 lines
3.2 KiB
PHP
125 lines
3.2 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace app\api\controller;
|
||
|
|
|
||
|
|
use app\common\controller\Api;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 宝箱接口
|
||
|
|
*/
|
||
|
|
class Box extends Common
|
||
|
|
{
|
||
|
|
//开宝箱
|
||
|
|
public function open_box()
|
||
|
|
{
|
||
|
|
$tid = input('tid', 0);
|
||
|
|
$open_num = input('open_num', 0);
|
||
|
|
$rid = input('rid', 0);
|
||
|
|
$reslut = model('Box')->open_box($this->uid, $rid, $tid, $open_num);
|
||
|
|
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//获取暴条数据
|
||
|
|
public function get_bt_consume(){
|
||
|
|
$type = input('type', 0);
|
||
|
|
$reslut = model('Box')->box_store_consume($this->uid,$type);
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//获取奖池礼物列表
|
||
|
|
public function get_box_list()
|
||
|
|
{
|
||
|
|
$tid = input('tid', 0);
|
||
|
|
$rid = input('rid',1);
|
||
|
|
$reslut = model('Box')->get_box_list($tid,$rid);
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
|
||
|
|
//获取奖池礼物列表
|
||
|
|
public function get_box_lists()
|
||
|
|
{
|
||
|
|
$tid = input('tid', 0);
|
||
|
|
$rid = input('rid',1);
|
||
|
|
$reslut = model('Box')->get_box_lists($tid,$rid);
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
|
||
|
|
//获取开宝箱手气榜
|
||
|
|
public function get_box_user_sqb_rank()
|
||
|
|
{
|
||
|
|
$rid = input('rid', 0);
|
||
|
|
$box_type = input('box_type', 1);
|
||
|
|
$page = input('page', 1);
|
||
|
|
$limit = input('limit', 20);
|
||
|
|
$reslut = model('Box')->get_box_user_sqb_rank($rid, $box_type, $page, $limit);
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
//获取用户开出礼物记录
|
||
|
|
public function get_user_box_gift_list()
|
||
|
|
{
|
||
|
|
$page = input('page', 1);
|
||
|
|
$limit = input('limit', 20);
|
||
|
|
$box_type = input('box_type', 0);
|
||
|
|
$reslut = model('Box')->get_user_box_gift_list($this->uid, $box_type, $page, $limit);
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
//获取宝箱说明
|
||
|
|
public function get_box_note()
|
||
|
|
{
|
||
|
|
$type = input('type', 1);
|
||
|
|
$reslut = model('Box')->get_box_note($type);
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//用户投入产出爆率
|
||
|
|
public function get_user_box_count(){
|
||
|
|
$type = input('type',1);
|
||
|
|
$reslut = model('Box')->get_user_box_count($this->uid,$type);
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
|
||
|
|
// 实时榜单
|
||
|
|
//获取开宝箱榜
|
||
|
|
public function get_box_user_gift_rank()
|
||
|
|
{
|
||
|
|
$page = input('page', 1);
|
||
|
|
$limit = input('page_limit', 20);
|
||
|
|
$reslut = model('Box')->get_box_user_gift_rank($page, $limit);
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
|
||
|
|
//获取投入榜单
|
||
|
|
public function get_box_user_out_amount_rank()
|
||
|
|
{
|
||
|
|
$box_type = input('box_type', 1);
|
||
|
|
$time_type = input('time_type', 1);
|
||
|
|
$reslut = model('Box')->get_box_user_out_amount_rank($box_type, $time_type);
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
public function get_user_box_times()
|
||
|
|
{
|
||
|
|
$reslut = model('Box')->get_user_box_times($this->uid);
|
||
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|