作者 李忠强

更新

... ... @@ -189,7 +189,7 @@ class Index extends Api
* @ApiParams (name=page, type=integer, required=false, description="页数 默认1")
* @ApiReturn ({
'code':'1',
'msg':'返回成功'
'msg':'搜索'
'data':{
"total": 4,
"per_page": 10,
... ... @@ -249,4 +249,30 @@ class Index extends Api
$this->success('搜索',$list);
}
/**
* @ApiTitle (搜索历史)
* @ApiMethod (POST)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiReturn ({
'code':'1',
'msg':'搜索历史'
'data':{
})
*/
public function searchHistory()
{
if ($this->auth->isLogin()){
$list = Db::name('user_search')
->where('user_id',$this->auth->id)
->limit(10)
->order('id','desc')
->column('text');
}else{
$list = [];
}
$this->success('搜索历史',$list);
}
}
... ...