root пре 2 година
родитељ
комит
5a4b87dd7d

+ 1 - 1
backendApi/modules/v1/controllers/ConfigController.php

@@ -70,7 +70,7 @@ class ConfigController extends BaseController {
      */
     public function actionBase() {
         // 获取priod的相关配置参数
-        $configs = Config::find()->where("TYPE='base'")->orderBy('SORT ASC')->indexBy('CONFIG_NAME')->asArray()->all();
+        $configs = Config::actionBaseConfig(); //Config::find()->where("TYPE='base'")->orderBy('SORT ASC')->indexBy('CONFIG_NAME')->asArray()->all();
 
         $form = new ConfigForm();
         if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {

+ 1 - 1
common/helpers/Tool.php

@@ -534,7 +534,7 @@ class Tool {
      */
     public static function convertLanguage($selData, $dbIndex = 'LEVEL_NAME') {
         foreach ($selData as $k => &$v) {
-            if (isset($v['LANGUAGE_KEY'])) {
+            if (isset($v['LANGUAGE_KEY']) && !empty($v['LANGUAGE_KEY'])) {
                 $v[$dbIndex] = \Yii::t('ctx', $v['LANGUAGE_KEY']);
             }
         }

+ 1 - 1
common/messages/en-US/ctx.php

@@ -114,7 +114,7 @@ return [
     'dbConfigShowWithdrawPeriodNum' => '前台可见提现记录期数',
     'dbConfigSiteClose' => '是否关闭网站',
     'dbConfigSiteCloseInfo' => '关闭提示信息',
-    'dbConfigSiteTitle' => '网站标题',
+    'dbConfigSiteTitle' => '网站标题en-us',
     'dbConfigTransferOpen' => '是否开启转账功能',
     'dbConfigTransferRecordSwitch' => '前台转账记录开关',
     'dbConfigTransferSwitch' => '前台我要转账开关',

+ 8 - 0
common/models/Config.php

@@ -3,6 +3,7 @@
 namespace common\models;
 
 use common\helpers\Cache;
+use common\helpers\Tool;
 use Yii;
 use common\libs\logging\operate\valueType\Config as ValueTypeConfig;
 
@@ -175,4 +176,11 @@ class Config extends \common\components\ActiveRecord
         return $data;
     }
 
+    public static function actionBaseConfig() {
+        $data = Config::find()->where("TYPE='base'")->orderBy('SORT ASC')->indexBy('CONFIG_NAME')->asArray()->all();
+        $data = Tool::convertLanguage($data, 'TITLE');
+
+        return $data;
+    }
+
 }