|
@@ -1,31 +0,0 @@
|
|
|
-<?php
|
|
|
-/**
|
|
|
- * Created by PhpStorm.
|
|
|
- * User: Administrator
|
|
|
- * Date: 2019-06-18
|
|
|
- * Time: 17:19
|
|
|
- */
|
|
|
-
|
|
|
-namespace App\Repositories;
|
|
|
-namespace App\Repositories;
|
|
|
-
|
|
|
-use App\Models\PostCollect;
|
|
|
-use Tymon\JWTAuth\JWTAuth;
|
|
|
-
|
|
|
-class PostCollectRepository {
|
|
|
- public function __construct(PostCollect $postCollect) {
|
|
|
- $this->postCollect = $postCollect;
|
|
|
- }
|
|
|
- //列表
|
|
|
- public function lists($request){
|
|
|
- $token = JWTAuth::decode(JWTAuth::getToken());
|
|
|
- $uid = $token['user']->uid;
|
|
|
- $perPage = isset($request['per_page']) ? $request['per_page'] : 20;
|
|
|
-
|
|
|
- return $this->postCollect
|
|
|
- ->join('post', 'post.id', '=', 'post_collect.post_id')
|
|
|
- ->select('post_collect.id','post_collect.uid','post.*')
|
|
|
- ->where(['post.uid'=>$uid])
|
|
|
- ->paginate($perPage);
|
|
|
- }
|
|
|
-}
|