|
@@ -28,6 +28,8 @@ use Illuminate\Support\Carbon;
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
use Illuminate\Support\Facades\Redis;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
+use Tymon\JWTAuth\Facades\JWTAuth;
|
|
|
+
|
|
|
|
|
|
class PostRepositories
|
|
|
{
|
|
@@ -573,6 +575,14 @@ class PostRepositories
|
|
|
->where('type', 'video')
|
|
|
->get();
|
|
|
}
|
|
|
-
|
|
|
+ //用户内容数,转发数,收藏数统计
|
|
|
+ public function memberPostStatistics(){
|
|
|
+ $token = JWTAuth::decode(JWTAuth::getToken());
|
|
|
+ $postCount = $this->post->where('uid',$token['user']->uid)->count();
|
|
|
+ $postCollectCount = $this->postCollect->where('uid',$token['user']->uid)->count();
|
|
|
+ $postShareCount = $this->postShare->where('uid',$token['user']->uid)->count();
|
|
|
+ $data = ['post_count'=>$postCount,'share_count'=>$postShareCount,'collect_count'=>$postCollectCount];
|
|
|
+ return jsonSuccess($data);
|
|
|
+ }
|
|
|
|
|
|
}
|