初始化代码
This commit is contained in:
154
application/api/controller/Sprite.php
Normal file
154
application/api/controller/Sprite.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Controller;
|
||||
|
||||
class Sprite extends Common
|
||||
{
|
||||
|
||||
//选择兑换数量列表
|
||||
public function choice_amount_list(){
|
||||
$reslut = model('Sprite')->choice_amount_list($this->uid);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//兑换门票
|
||||
public function exchange_airship(){
|
||||
$uid = $this->uid;
|
||||
$rid = input('rid', 0);
|
||||
$num = input('num', 0);
|
||||
$key_name = "api:Sprite:exchange_airship:uid:".$uid;
|
||||
redis_lock_exit($key_name);
|
||||
$reslut = model('Sprite')->exchange_airship($uid, $rid, $num);
|
||||
redis_unlock($key_name);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//当前玩法详情
|
||||
public function get_monster_info(){
|
||||
$uid = $this->uid;
|
||||
$reslut = model('Sprite')->get_monster_info($uid);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
//生成/结算玩法
|
||||
public function create_monster_log(){
|
||||
$uid = $this->uid;
|
||||
$key_name = "api:Sprite:create_monster_log";
|
||||
redis_lock_exit($key_name);
|
||||
$reslut = model('Sprite')->create_sprite_log(2);
|
||||
redis_unlock($key_name);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
//玩法投入【单个】
|
||||
public function open_beat_monster(){
|
||||
$uid = $this->uid;
|
||||
$rid = input('rid', 0);
|
||||
$type = input('type', 0);
|
||||
$money = input('money', 0);
|
||||
$num = input('num', 0);
|
||||
$key_name = "api:Sprite:open_beat_monster:uid:".$uid;
|
||||
redis_lock_exit($key_name);
|
||||
$reslut = model('Sprite')->open_beat_monster($uid, $rid, $type, $money, $num);
|
||||
redis_unlock($key_name);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
//玩法投入【多个】
|
||||
public function open_explore_star(){
|
||||
$uid = $this->uid;
|
||||
$rid = input('rid', 0);
|
||||
$open_data = input('open_data','');
|
||||
$key_name = "api:Sprite:open_explore_star:uid:".$uid;
|
||||
redis_lock_exit($key_name);
|
||||
$reslut = model('Sprite')->open_explore_star($uid, $rid, $open_data);
|
||||
redis_unlock($key_name);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
//规则
|
||||
public function get_monster_note(){
|
||||
$reslut = model('Sprite')->get_monster_note();
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//奖池
|
||||
public function get_monster_box_list(){
|
||||
$reslut = model('Sprite')->get_monster_box_list();
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
//开奖记录
|
||||
public function get_monster_log(){
|
||||
$uid = $this->uid;
|
||||
$page = input('page', 1);
|
||||
$page_limit = input('page_limit', 20);
|
||||
$reslut = model('Sprite')->get_monster_log($uid, $page, $page_limit);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//我的记录
|
||||
public function get_user_monster_log(){
|
||||
$uid = $this->uid;
|
||||
$page = input('page', 1);
|
||||
$page_limit = input('page_limit', 20);
|
||||
$reslut = model('Sprite')->get_user_monster_log($uid, $page, $page_limit);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
//本期记录
|
||||
public function get_now_user_monster_feed_log(){
|
||||
$uid = $this->uid;
|
||||
$page = input('page', 1);
|
||||
$page_limit = input('page_limit', 20);
|
||||
$reslut = model('Sprite')->get_now_user_monster_feed_log($uid, $page, $page_limit);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//消费记录
|
||||
public function get_user_monster_feed_log(){
|
||||
$uid = $this->uid;
|
||||
$page = input('page', 1);
|
||||
$page_limit = input('page_limit', 20);
|
||||
$reslut = model('Sprite')->get_user_monster_feed_log($uid, $page, $page_limit);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
//用户榜
|
||||
public function get_user_monster_rank(){
|
||||
$uid = $this->uid;
|
||||
$page = input('page', 1);
|
||||
$page_limit = input('page_limit', 20);
|
||||
$reslut = model('Sprite')->get_user_monster_rank($uid, $page, $page_limit);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
//当前中奖记录信息
|
||||
public function get_user_win_monster_list(){
|
||||
$uid = $this->uid;
|
||||
$rid = input('rid', 0);
|
||||
$reslut = model('Sprite')->get_user_win_monster_list($uid, $rid);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
public function get_monsters_log(){
|
||||
$uid = $this->uid;
|
||||
$page = input('page', 1);
|
||||
$page_limit = input('page_limit', 20);
|
||||
$reslut = model('Sprite')->get_monsters_log($uid, $page, $page_limit);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user