wesmiler 2 년 전
부모
커밋
cb65d1283b
2개의 변경된 파일8개의 추가작업 그리고 7개의 파일을 삭제
  1. 6 5
      app/Http/Controllers/Api/v1/VideoController.php
  2. 2 2
      app/Services/LiveService.php

+ 6 - 5
app/Http/Controllers/Api/v1/VideoController.php

@@ -21,16 +21,16 @@ class VideoController extends webApp
      */
     public function index()
     {
-//       try {
+       try {
            $params = request()->post();
            $pageSize = request()->post('pageSize', 0);
            $params['is_recommend'] = 1;
            $datas = VideoService::make()->getIndexList($params, $pageSize,'', $this->userId);
            return message(1010, true, $datas);
-//       } catch (\Exception $exception){
-//           RedisService::set("caches:request:error_video_index", ['error'=>$exception->getMessage(),'trace'=>$exception->getTrace()], 7200);
-//           return message(1018, false, ['error'=>env('APP_DEBUG')? $exception->getMessage() : '']);
-//       }
+       } catch (\Exception $exception){
+           RedisService::set("caches:request:error_video_index", ['error'=>$exception->getMessage(),'trace'=>$exception->getTrace()], 7200);
+           return message(1018, false, ['error'=>env('APP_DEBUG')? $exception->getMessage() : '']);
+       }
     }
 
     /**
@@ -44,6 +44,7 @@ class VideoController extends webApp
             $pageSize = request()->post('pageSize', 0);
             $type = request()->post('type', 1);
             // 我的视频
+            $datas = [];
             if($type == 1){
                 $datas = VideoService::make()->getDataList($params, $pageSize,'', $this->userId);
             }

+ 2 - 2
app/Services/LiveService.php

@@ -100,8 +100,8 @@ class LiveService extends BaseService
 
                 if ($userId) {
                     $query->where('a.visible_users', '=', '')
-                        ->orWhereIn('a.visible_users', 'like',"%{$userId},%")
-                        ->orWhereIn('a.manage_users', 'like',"%{$userId},%");
+                        ->orWhere('a.visible_users', 'like',"%{$userId},%")
+                        ->orWhere('a.manage_users', 'like',"%{$userId},%");
                 }
             });