作者 郭盛
1 个管道 的构建 通过 耗费 1 秒

修改历史记录

... ... @@ -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);
}
... ...