瀏覽代碼

add $this->lang

visuddhinanda 2 年之前
父節點
當前提交
6d574f0a52
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      app/Http/Api/TemplateRender.php

+ 11 - 0
app/Http/Api/TemplateRender.php

@@ -45,6 +45,17 @@ class TemplateRender{
         $this->format = $format;
         $this->format = $format;
         $this->studioId = $studioId;
         $this->studioId = $studioId;
         $this->debug = $debug;
         $this->debug = $debug;
+
+        if(count($this->channel_id)>0){
+            $channelId = $this->channel_id[0];
+            if(Str::isUuid($channelId)){
+                $lang = Channel::where('uid',$channelId)->value('lang');
+                if(!empty($lang)){
+                    $this->lang = $lang;
+                    $this->langFamily = explode('-',$lang)[0];
+                }
+            }
+        }
     }
     }
     private function info($message,$debug){
     private function info($message,$debug){
         if(in_array($debug,$this->debug)){
         if(in_array($debug,$this->debug)){