...
|
...
|
@@ -9,7 +9,9 @@ namespace app\portal\controller; |
|
|
use app\portal\model\UserModel;
|
|
|
use app\portal\validate\UsersValidate;
|
|
|
use cmf\controller\HomeBaseController;
|
|
|
use app\portal\model\CollectionModel;
|
|
|
use cmf\lib\Storage;
|
|
|
use think\Db;
|
|
|
use anerg\OAuth2\OAuth;
|
|
|
use think\Config;
|
|
|
|
...
|
...
|
@@ -170,6 +172,40 @@ class LoginController extends HomeBaseController |
|
|
}
|
|
|
}
|
|
|
|
|
|
//我的收藏列表
|
|
|
public function myCollection(){
|
|
|
$limit = 8;
|
|
|
$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);
|
|
|
$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)
|
|
|
->where('delete_time', 0)
|
|
|
->field('id,post_title,post_excerpt,post_favorites')
|
|
|
->order('weigh desc')
|
|
|
->select()
|
|
|
->toArray();
|
|
|
foreach($data['data'] as &$value){
|
|
|
foreach ($data1 as $item) {
|
|
|
if($value['post_id'] == $item['id']){
|
|
|
$value['post_title'] = $item['post_title'];
|
|
|
$value['post_excerpt'] = $item['post_excerpt'];
|
|
|
$value['post_favorites'] = $item['post_favorites'];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$this->assign('res',$data['data']);
|
|
|
$this->assign('page',$page);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
|
|
//第三方微信登录
|
|
|
public function wx_login(){
|
|
|
$config = Config::get('wx_login');
|
...
|
...
|
|