43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace app\api\controller;
|
||
|
|
|
||
|
|
use app\common\controller\BaseCom;
|
||
|
|
use think\Controller;
|
||
|
|
|
||
|
|
|
||
|
|
class Suggest extends BaseCom
|
||
|
|
{
|
||
|
|
/*
|
||
|
|
* 用户反馈
|
||
|
|
*/
|
||
|
|
//初始化
|
||
|
|
protected function initialize()
|
||
|
|
{
|
||
|
|
//允许跨域
|
||
|
|
header('Access-Control-Allow-Origin: *');
|
||
|
|
}
|
||
|
|
|
||
|
|
//用户反馈
|
||
|
|
public function create_suggest()
|
||
|
|
{
|
||
|
|
$key_name = "api:suggest:create_suggest:" . $this->uid;
|
||
|
|
redis_lock_exit($key_name);
|
||
|
|
$image = input('image', 0);
|
||
|
|
$content = input('content', 0);
|
||
|
|
$tell = input('tell', 0);
|
||
|
|
$reslut = model('Suggest')->create_suggest($this->uid, $image, $content,$tell);
|
||
|
|
redis_unlock($key_name);
|
||
|
|
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
//我的反馈
|
||
|
|
public function my_suggest(){
|
||
|
|
$page = input('page', 1);
|
||
|
|
$page_limit = input('page_limit', 15);
|
||
|
|
$reslut = model('Suggest')->suggest_list($this->uid,$page,$page_limit);
|
||
|
|
$reslut['data']['page'] = $page;
|
||
|
|
$reslut['data']['page_limit'] = $page_limit;
|
||
|
|
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||
|
|
}
|
||
|
|
}
|