初始化代码
This commit is contained in:
32
application/api/controller/Guard.php
Normal file
32
application/api/controller/Guard.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Controller;
|
||||
|
||||
class Guard extends Common
|
||||
{
|
||||
//获取可购买守护列表
|
||||
public function get_guard_list()
|
||||
{
|
||||
$reslut = model('Guard')->get_guard_list();
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
//购买守护
|
||||
public function buy_guard()
|
||||
{
|
||||
$id = input('id');
|
||||
$guard_rid = input('guard_rid');
|
||||
$guard_uid = input('guard_uid');
|
||||
$reslut = model('Guard')->buy_guard($this->uid, $id, $guard_rid, $guard_uid);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
//获取用户守护列表
|
||||
public function get_user_guard_list()
|
||||
{
|
||||
$page = input('page', 1);
|
||||
$page_limit = input('page_limit', 10);
|
||||
$reslut = model('Guard')->get_user_guard_list($this->uid, $page, $page_limit);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user