Bläddra i källkod

查不到channel 返回404

visuddhinanda 1 år sedan
förälder
incheckning
92cab32897
1 ändrade filer med 3 tillägg och 0 borttagningar
  1. 3 0
      api-v8/app/Http/Controllers/ChannelController.php

+ 3 - 0
api-v8/app/Http/Controllers/ChannelController.php

@@ -541,6 +541,9 @@ class ChannelController extends Controller
         //
         //
         $indexCol = ['uid','name','summary','type','owner_uid','lang','is_system','status','updated_at','created_at'];
         $indexCol = ['uid','name','summary','type','owner_uid','lang','is_system','status','updated_at','created_at'];
 		$channel = Channel::where("uid",$id)->select($indexCol)->first();
 		$channel = Channel::where("uid",$id)->select($indexCol)->first();
+        if(!$channel){
+            return $this->error('no res');
+        }
         $studio = StudioApi::getById($channel->owner_uid);
         $studio = StudioApi::getById($channel->owner_uid);
         $channel->studio = $studio;
         $channel->studio = $studio;
         $channel->owner_info = ['nickname'=>$studio['nickName'],'username'=>$studio['realName']];
         $channel->owner_info = ['nickname'=>$studio['nickName'],'username'=>$studio['realName']];