...
|
...
|
@@ -112,7 +112,16 @@ class LoginController extends HomeBaseController |
|
|
|
|
|
//首页个人中心
|
|
|
public function info(){
|
|
|
return $this->fetch();
|
|
|
$login = cmf_is_user_login();
|
|
|
if($login) {
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//退出登录
|
|
|
public function logout(){
|
|
|
cmf_update_current_user(NULL);
|
|
|
$this->apiResponse(1,'退出成功!');
|
|
|
}
|
|
|
|
|
|
//首页个人中心修改头像
|
...
|
...
|
@@ -157,7 +166,10 @@ class LoginController extends HomeBaseController |
|
|
|
|
|
//个人中心编辑页面
|
|
|
public function editInfo(){
|
|
|
return $this->fetch();
|
|
|
$login = cmf_is_user_login();
|
|
|
if($login) {
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//个人中心编辑提交
|
...
|
...
|
@@ -186,23 +198,25 @@ class LoginController extends HomeBaseController |
|
|
|
|
|
//我的收藏列表
|
|
|
public function myCollection(){
|
|
|
$limit = $this->limit;
|
|
|
$uid = cmf_get_current_user_id();
|
|
|
$login = cmf_is_user_login();
|
|
|
if($login) {
|
|
|
$limit = $this->limit;
|
|
|
$uid = cmf_get_current_user_id();
|
|
|
// $collectionModel = new CollectionModel();
|
|
|
// $res = $collectionModel
|
|
|
// ->where(['uid'=>$uid])
|
|
|
// ->field('id,post_id,category_name,city_name,post_url')
|
|
|
// ->order('id desc')
|
|
|
// ->paginate($limit);
|
|
|
$res = Db::name('collection')
|
|
|
->alias('c')
|
|
|
->join('portal_post p','c.post_id = p.id')
|
|
|
->where(['c.uid'=>$uid,'p.delete_time'=>0])
|
|
|
->field('c.id,c.category_name,c.city_name,c.post_url,p.post_title,p.post_excerpt,p.post_favorites')
|
|
|
->order('c.id desc')
|
|
|
->paginate($limit);
|
|
|
$data = $res->toArray();
|
|
|
$page = $res->render();
|
|
|
$res = Db::name('collection')
|
|
|
->alias('c')
|
|
|
->join('portal_post p','c.post_id = p.id')
|
|
|
->where(['c.uid'=>$uid,'p.delete_time'=>0])
|
|
|
->field('c.id,c.category_name,c.city_name,c.post_url,p.post_title,p.post_excerpt,p.post_favorites')
|
|
|
->order('c.id desc')
|
|
|
->paginate($limit);
|
|
|
$data = $res->toArray();
|
|
|
$page = $res->render();
|
|
|
// $post_ids = array_unique(array_column($data['data'],'post_id'));
|
|
|
// $data1 = Db::name('portal_post')
|
|
|
// ->whereIn('id',$post_ids)
|
...
|
...
|
@@ -223,9 +237,10 @@ class LoginController extends HomeBaseController |
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
$this->assign('res',$data['data']);
|
|
|
$this->assign('page',$page);
|
|
|
return $this->fetch();
|
|
|
$this->assign('res',$data['data']);
|
|
|
$this->assign('page',$page);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//搜索列表
|
...
|
...
|
|