连线传奇 搬移。
This commit is contained in:
102
application/api/controller/Monster.php
Normal file
102
application/api/controller/Monster.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\controller\BaseCom;
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* 活动:
|
||||
* 1.首充好礼
|
||||
*
|
||||
*/
|
||||
class Monster extends BaseCom
|
||||
{
|
||||
//初始化
|
||||
protected function initialize()
|
||||
{
|
||||
//允许跨域
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
}
|
||||
|
||||
|
||||
//选择金币列表
|
||||
public function choice_gold_list(){
|
||||
$reslut = model('Monster')->choice_gold_list();
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
//游戏详情
|
||||
public function get_monster_info(){
|
||||
$uid = $this->uid;
|
||||
$reslut = model('Monster')->get_monster_info($uid);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//生成/结算喂养怪兽
|
||||
public function create_monster_log(){
|
||||
$uid = $this->uid;
|
||||
$key_name = "api:Monster:create_monster_log";
|
||||
redis_lock_exit($key_name);
|
||||
$reslut = model('Monster')->create_monster_log();
|
||||
redis_unlock($key_name);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//喂养怪兽
|
||||
public function open_beat_monster(){
|
||||
$uid = $this->uid;
|
||||
$rid = input('rid', 0);
|
||||
$type = input('type', 0);
|
||||
$num = input('num', 0);
|
||||
$key_name = "api:Monster:open_beat_monster:uid:".$uid;
|
||||
redis_lock_exit($key_name);
|
||||
$reslut = model('Monster')->open_beat_monster($uid, $rid, $type, $num);
|
||||
redis_unlock($key_name);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
//规则
|
||||
public function get_monster_note(){
|
||||
$reslut = model('Monster')->get_monster_note();
|
||||
return V($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('Monster')->get_monster_log($uid, $page, $page_limit);
|
||||
return V($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('Monster')->get_user_monster_log($uid, $page, $page_limit);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//中奖次数榜单
|
||||
public function get_monster_winner_num_list(){
|
||||
$uid = $this->uid;
|
||||
$time = input('time', 1);
|
||||
$reslut = model('Monster')->get_monster_winner_num_list($uid, $time);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
//设置房间期数开关
|
||||
public function operate_room_monster_show_status(){
|
||||
$uid = $this->uid;
|
||||
$rid = input('rid', 0);
|
||||
$is_show_monster_push = input('is_show_monster_push', 1);
|
||||
$reslut = model('Monster')->operate_room_monster_show_status($uid, $rid, $is_show_monster_push);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user