...
|
...
|
@@ -360,19 +360,27 @@ class Index extends Api |
|
|
*/
|
|
|
public function history()
|
|
|
{
|
|
|
$user_id = $this->getUserId();
|
|
|
$data['list'] = Db::name('keyword')
|
|
|
->where('user_id',$user_id)
|
|
|
->field('id,keyword')
|
|
|
->limit(4)
|
|
|
->order('id desc')
|
|
|
->select();
|
|
|
$data['hotlist'] = Db::name('hotword')
|
|
|
->field('num,createtime',true)
|
|
|
->order('num desc')
|
|
|
->limit(10)
|
|
|
->select();
|
|
|
|
|
|
$token = $this->request->header('token');
|
|
|
if(empty($token)){
|
|
|
$data['hotlist'] = Db::name('hotword')
|
|
|
->field('num,createtime',true)
|
|
|
->order('num desc')
|
|
|
->limit(10)
|
|
|
->select();
|
|
|
}else{
|
|
|
$user_id = $this->getUserId();
|
|
|
$data['list'] = Db::name('keyword')
|
|
|
->where('user_id',$user_id)
|
|
|
->field('id,keyword')
|
|
|
->limit(4)
|
|
|
->order('id desc')
|
|
|
->select();
|
|
|
$data['hotlist'] = Db::name('hotword')
|
|
|
->field('num,createtime',true)
|
|
|
->order('num desc')
|
|
|
->limit(10)
|
|
|
->select();
|
|
|
}
|
|
|
$this->success('SUCCESS',$data);
|
|
|
}
|
|
|
|
...
|
...
|
|