Browse Source

多处基础修改

lizhen_gitee 1 year ago
parent
commit
211978768b

+ 1 - 1
application/api/controller/Baseconfig.php

@@ -53,7 +53,7 @@ class Baseconfig extends Api
     //启动广告图
     public function start_advert(){
         $info = Db::name('start_advert')->where('is_show',1)->order('id desc')->find();
-        $info = info_domain_image($info,['images','video_file']);
+        $info = info_domain_image($info,['image','video_file']);
         $this->success_find('success',$info);
     }
 

+ 3 - 2
application/api/controller/Sms.php

@@ -21,9 +21,10 @@ class Sms extends Api
 
         $map = [];
         if(!empty($keyword)){
-            $map['en|cn|code'] = ['LIKE','%'.$keyword.'%'];
+            $map['name_en|name|code'] = ['LIKE','%'.$keyword.'%'];
         }
-        $list = Db::name('country_code')->where($map)->order('en asc')->select();
+        $list = Db::name('country_code')->where($map)->order('name_en asc')->select();
+        $list = $this->list_lang($list,['name']);
         $this->success(1,$list);
     }
 

+ 1 - 1
application/common.php

@@ -574,7 +574,7 @@ function localpath_to_netpath($path)
     } elseif (strrpos($path, 'http') !== false) {
         return $path;
     } else {
-        return config('site.domain_cdnurl') . str_replace("\\", "/", $path);
+        return config('domain_cdnurl') . str_replace("\\", "/", $path);
     }
 }
 

+ 3 - 0
application/config.php

@@ -309,4 +309,7 @@ return [
         'appid'=>'', //公司测试
         'secret'=>'', //公司测试
     ],
+
+    //图片地址
+    'domain_cdnurl' => 'http://www.yueke.com',
 ];

+ 9 - 10
application/index/controller/Index.php

@@ -2,19 +2,11 @@
 
 namespace app\index\controller;
 
-use app\common\controller\Frontend;
+use think\Controller;
 use think\Db;
-class Index extends Frontend
+class Index extends Controller
 {
 
-    protected $noNeedLogin = '*';
-    protected $noNeedRight = '*';
-    protected $layout = '';
-
-    public function index()
-    {
-        return $this->view->fetch();
-    }
 
     //基础文章网页
     public function basedata(){
@@ -22,12 +14,19 @@ class Index extends Frontend
         if(!$key){
             exit;
         }
+        $lang = input('lang','');
+
         $content = Db::name('basedata')->where('key',$key)->find();
+
+        if($lang == 'EN'){
+            $content['content'] = $content['content_en'];
+        }
         $this->assign('content',$content['content']);
         return $this->fetch();
     }
 
 
+
     /**
      * app下载页
      * 判断是安卓还是ios