visuddhinanda 2 лет назад
Родитель
Сommit
7a4a21bf96
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      app/Http/Resources/ArticleResource.php

+ 8 - 1
app/Http/Resources/ArticleResource.php

@@ -124,7 +124,14 @@ class ArticleResource extends JsonResource
         if(isset($this->content) && !empty($this->content)){
             if($request->has('channel')){
                 $channels = explode('_',$request->get('channel')) ;
-            }else{
+            }else if($request->has('anthology')){
+                $defaultChannel = Collection::where('uid',$request->get('anthology'))
+                                    ->value('default_channel');
+                if($defaultChannel){
+                    $channels[] = $defaultChannel;
+                }
+            }
+            if(count($channels) === 0){
                 //查找用户默认channel
                 $studioChannel = Channel::where('owner_uid',$this->owner)
                                         ->where('type','translation')