|
|
@@ -99,7 +99,7 @@ class ConfigController extends BaseController {
|
|
|
* @throws \yii\web\HttpException
|
|
|
*/
|
|
|
public function actionBonusOpt() {
|
|
|
- $configs = Config::find()->where("TYPE='bonus'")->orderBy('SORT ASC')->indexBy('CONFIG_NAME')->asArray()->all();
|
|
|
+ $configs = Config::actionBonusOpt();//Config::find()->where("TYPE='bonus'")->orderBy('SORT ASC')->indexBy('CONFIG_NAME')->asArray()->all();
|
|
|
foreach ($configs as $key => $config) {
|
|
|
if ($config['OPTIONS']) {
|
|
|
$configs[$key]['OPTIONS'] = Json::decode($config['OPTIONS']);
|
|
|
@@ -115,7 +115,7 @@ class ConfigController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
// 获取会员报单级别的相关参数
|
|
|
- $decLevel = DeclarationLevel::find()->orderBy('SORT ASC')->asArray()->all();
|
|
|
+ $decLevel = DeclarationLevel::configGetDeclarationLevelOrderBySort();//DeclarationLevel::find()->orderBy('SORT ASC')->asArray()->all();
|
|
|
// 获取会员聘级相关参数
|
|
|
$empLevel = EmployLevel::getAllDataWithNumIndex();
|
|
|
// 获取会员星级相关参数
|
|
|
@@ -371,6 +371,7 @@ class ConfigController extends BaseController {
|
|
|
public function actionTransfer() {
|
|
|
// 获取priod的相关配置参数
|
|
|
$configs = Config::find()->where("TYPE='transfer'")->orderBy('SORT ASC')->indexBy('CONFIG_NAME')->asArray()->all();
|
|
|
+ $configs = Tool::convertLanguage($configs, 'TITLE');
|
|
|
$form = new ConfigForm();
|
|
|
if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {
|
|
|
if ($form->updateTransfer()) {
|
|
|
@@ -403,6 +404,7 @@ class ConfigController extends BaseController {
|
|
|
public function actionScore() {
|
|
|
// 获取priod的相关配置参数
|
|
|
$configs = Config::find()->where("TYPE='score'")->orderBy('SORT ASC')->indexBy('CONFIG_NAME')->asArray()->all();
|
|
|
+ $configs = Tool::convertLanguage($configs, 'TITLE');
|
|
|
$form = new ConfigForm();
|
|
|
if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {
|
|
|
if ($form->updateScore()) {
|
|
|
@@ -435,6 +437,7 @@ class ConfigController extends BaseController {
|
|
|
public function actionOther() {
|
|
|
// 获取priod的相关配置参数
|
|
|
$configs = Config::find()->where("TYPE='other'")->orderBy('SORT ASC')->indexBy('CONFIG_NAME')->asArray()->all();
|
|
|
+ $configs = Tool::convertLanguage($configs, 'TITLE');
|
|
|
$form = new ConfigForm();
|
|
|
if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {
|
|
|
if ($form->updateOther()) {
|
|
|
@@ -484,6 +487,14 @@ class ConfigController extends BaseController {
|
|
|
$data = DeclarationLevel::lists('', [], [
|
|
|
'orderBy' => 'SORT ASC, CREATED_AT ASC'
|
|
|
]);
|
|
|
+ if (!empty($data['list'])) {
|
|
|
+ foreach ($data['list'] as &$v) {
|
|
|
+ if (isset($v['LANGUAGE_KEY']) && !empty($v['LANGUAGE_KEY'])) {
|
|
|
+ $v['TITLE'] = \Yii::t('ctx', $v['LANGUAGE_KEY']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return static::notice($data);
|
|
|
}
|
|
|
|
|
|
@@ -502,11 +513,16 @@ class ConfigController extends BaseController {
|
|
|
->where("CONFIG_NAME='observePeriodLimit'")
|
|
|
->asArray()
|
|
|
->one();
|
|
|
+ if (!empty($data) && isset($data['LANGUAGE_KEY']) && !empty($data['LANGUAGE_KEY'])) {
|
|
|
+ $data['TITLE'] = \Yii::t('ctx', $data['LANGUAGE_KEY']);
|
|
|
+ }
|
|
|
$isSwitchUpgrade = Config::find()
|
|
|
->where("CONFIG_NAME='isOpenUpgrade'")
|
|
|
->asArray()
|
|
|
->one();
|
|
|
-
|
|
|
+ if (!empty($isSwitchUpgrade) && isset($isSwitchUpgrade['LANGUAGE_KEY']) && !empty($isSwitchUpgrade['LANGUAGE_KEY'])) {
|
|
|
+ $isSwitchUpgrade['TITLE'] = \Yii::t('ctx', $isSwitchUpgrade['LANGUAGE_KEY']);
|
|
|
+ }
|
|
|
return static::notice([
|
|
|
'observe' => $data,
|
|
|
'isOpenUpgrade' => $isSwitchUpgrade
|
|
|
@@ -542,6 +558,14 @@ class ConfigController extends BaseController {
|
|
|
$data = DecRole::lists('', [], [
|
|
|
'orderBy' => 'SORT ASC'
|
|
|
]);
|
|
|
+ if (!empty($data['list'])) {
|
|
|
+ foreach ($data['list'] as &$v) {
|
|
|
+ if (isset($v['LANGUAGE_KEY']) && !empty($v['LANGUAGE_KEY'])) {
|
|
|
+ $v['ROLE_NAME'] = \Yii::t('ctx', $v['LANGUAGE_KEY']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return static::notice($data);
|
|
|
}
|
|
|
|
|
|
@@ -869,6 +893,8 @@ class ConfigController extends BaseController {
|
|
|
}
|
|
|
|
|
|
$oneData = Config::find()->where('CONFIG_NAME=:CONFIG_NAME', [':CONFIG_NAME' => 'exchangeRate'])->asArray()->one();
|
|
|
+ $oneData = Tool::convertLanguage($oneData, 'TITLE');
|
|
|
+
|
|
|
return static::notice($oneData);
|
|
|
}
|
|
|
}
|