You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

53 lines
1.3 KiB

<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Api\CommonController;
use Illuminate\Http\Request;
use App\Common\ReturnData;
use App\Common\Token;
use App\Http\Model\FeedBack;
class FeedBackController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function feedbackList(Request $request)
{
//参数
$data['limit'] = $request->input('limit', 10);
$data['offset'] = $request->input('offset', 0);
$res = FeedBack::getList($data);
if(!$res)
{
return ReturnData::create(ReturnData::SYSTEM_FAIL);
}
return ReturnData::create(ReturnData::SUCCESS,$res);
}
//添加意见反馈
public function feedbackAdd(Request $request)
{
//参数
$data['content'] = $request->input('content',null);
if($request->input('title', null) !== null){$data['title'] = $request->input('title');}
$data['user_id'] = Token::$uid;
if($data['content']===null)
{
return ReturnData::create(ReturnData::PARAMS_ERROR);
}
$res = FeedBack::add($data);
if(!$res)
{
return ReturnData::create(ReturnData::SYSTEM_FAIL);
}
return ReturnData::create(ReturnData::SUCCESS,$res);
}
}