239 lines
7.4 KiB
PHP
239 lines
7.4 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller;
|
|
|
|
use think\Controller;
|
|
|
|
class Play extends Common
|
|
{
|
|
|
|
//游戏列表
|
|
public function game_list()
|
|
{
|
|
$gid = input('gid', 0);
|
|
$game_name = input('game_name', 0);
|
|
$is_show = input('is_show', '');
|
|
|
|
$order = input('order', 'gid');
|
|
$sort = input('sort', 'desc');
|
|
$page = input('page', 1);
|
|
$limit = input('limit', 20);
|
|
$reslut = model('Play')->game_list($gid, $game_name, $is_show, $order, $sort, $page, $limit);
|
|
$data = [];
|
|
$data['code'] = 0;
|
|
$data['msg'] = '获取成功';
|
|
$data['count'] = $reslut['data']['count'];
|
|
$data['data'] = $reslut['data']['list'];
|
|
return json($data);
|
|
}
|
|
|
|
//获取 游戏 详情
|
|
public function game_info()
|
|
{
|
|
$gid = input('gid', 0);
|
|
$data = model('Play')->game_info($gid);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
//编辑 游戏
|
|
public function edit_game()
|
|
{
|
|
$data = input('post.');
|
|
$data = model('Play')->edit_game($data);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
|
|
//添加 游戏
|
|
public function add_game()
|
|
{
|
|
$data = input('post.');
|
|
$data = model('Play')->add_game($data);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
|
|
//删除 游戏
|
|
public function del_game()
|
|
{
|
|
$gid = input('gid', 0);
|
|
$data = model('Play')->del_game($gid);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
|
|
//游戏等级 列表
|
|
public function game_skill_level_list()
|
|
{
|
|
$lid = input('lid', 0);
|
|
$gid = input('gid', '');
|
|
$game_level_name = input('game_level_name', 0);
|
|
$order = input('order', 'a.lid');
|
|
$sort = input('sort', 'desc');
|
|
$page = input('page', 1);
|
|
$limit = input('limit', 20);
|
|
$reslut = model('Play')->game_skill_level_list($lid, $gid, $game_level_name, $order, $sort, $page, $limit);
|
|
$data = [];
|
|
$data['code'] = 0;
|
|
$data['msg'] = '获取成功';
|
|
$data['count'] = $reslut['data']['count'];
|
|
$data['data'] = $reslut['data']['list'];
|
|
return json($data);
|
|
}
|
|
|
|
//获取 游戏等级 详情
|
|
public function game_skill_level_info()
|
|
{
|
|
$lid = input('lid', 0);
|
|
$data = model('Play')->game_skill_level_info($lid);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
//编辑 游戏等级
|
|
public function edit_game_skill_level()
|
|
{
|
|
$data = input('post.');
|
|
$data = model('Play')->edit_game_skill_level($data);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
|
|
//添加 游戏等级
|
|
public function add_game_skill_level()
|
|
{
|
|
$data = input('post.');
|
|
$data = model('Play')->add_game_skill_level($data);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
|
|
//删除 游戏等级
|
|
public function del_game_skill_level()
|
|
{
|
|
$lid = input('lid', 0);
|
|
$data = model('Play')->del_game_skill_level($lid);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
|
|
//游戏等级 列表
|
|
public function player_list()
|
|
{
|
|
$uid = input('uid', 0);
|
|
$nick_name = input('nick_name', '');
|
|
$sex = input('sex', 0);
|
|
$special_uid = input('special_uid', 0);
|
|
$gid = input('gid', 0);
|
|
$real_name = input('real_name', 0);
|
|
$is_top = input('is_top', 0);
|
|
$is_recommend = input('is_recommend', 0);
|
|
$is_business = input('is_business', 0);
|
|
$status = input('status', 0);
|
|
$order = input('order', 'a.pid');
|
|
$sort = input('sort', 'desc');
|
|
$page = input('page', 1);
|
|
$limit = input('limit', 20);
|
|
$reslut = model('Play')->player_list($uid, $nick_name, $sex, $special_uid, $gid, $real_name, $is_top, $is_recommend, $is_business, $status, $order, $sort, $page, $limit);
|
|
$data = [];
|
|
$data['code'] = 0;
|
|
$data['msg'] = '获取成功';
|
|
$data['count'] = $reslut['data']['count'];
|
|
$data['data'] = $reslut['data']['list'];
|
|
return json($data);
|
|
}
|
|
|
|
//获取 陪玩主播 详情
|
|
public function player_info()
|
|
{
|
|
$pid = input('pid', 0);
|
|
$data = model('Play')->player_info($pid);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
//编辑 陪玩主播
|
|
public function edit_player()
|
|
{
|
|
$data = input('post.');
|
|
$data = model('Play')->edit_player($data);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
|
|
//删除 陪玩主播
|
|
public function del_player()
|
|
{
|
|
$pid = input('pid', 0);
|
|
$data = model('Play')->del_player($pid);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
|
|
// 陪玩订单 列表
|
|
public function player_order_list()
|
|
{
|
|
$order_sn = input('order_sn', 0);
|
|
$uid = input('uid', '');
|
|
$player_uid = input('player_uid', 0);
|
|
$price = input('price', 0);
|
|
$service_rate = input('service_rate', 0);
|
|
$status = input('status', 0);
|
|
$is_over = input('is_over', 0);
|
|
$order = input('order', '');
|
|
$sort = input('sort', '');
|
|
$page = input('page', 1);
|
|
$limit = input('limit', 20);
|
|
$reslut = model('Play')->player_order_list($order_sn, $uid, $player_uid, $price, $service_rate, $status, $is_over, $order, $sort, $page, $limit);
|
|
$data = [];
|
|
$data['code'] = 0;
|
|
$data['msg'] = '获取成功';
|
|
$data['count'] = $reslut['data']['count'];
|
|
$data['data'] = $reslut['data']['list'];
|
|
return json($data);
|
|
}
|
|
|
|
//获取 陪玩订单 详情
|
|
public function player_order_info()
|
|
{
|
|
$oid = input('oid', 0);
|
|
$data = model('Play')->player_order_info($oid);
|
|
if ($data['code'] == 0) {
|
|
return ajaxReturn(201, $data['msg'], $data['data']);
|
|
} else {
|
|
return ajaxReturn(200, $data['msg'], $data['data']);
|
|
}
|
|
}
|
|
}
|