joway 2 anni fa
parent
commit
f1f2b96e24

+ 7 - 7
backendApi/modules/v1/controllers/AdController.php

@@ -78,7 +78,7 @@ class AdController extends BaseController
      */
      */
     public function actionAdd(){
     public function actionAdd(){
         if(Yii::$app->request->isPost) {
         if(Yii::$app->request->isPost) {
-            return parent::edit(AdForm::class, 'Add Ad Succeed', null, null, null, function($formModel, $result){
+            return parent::edit(AdForm::class, Yii::t('ctx', 'AdAddedSuccessfully'), null, null, null, function($formModel, $result){
                 // 添加操作日志
                 // 添加操作日志
                 // Log::adminHandle('添加广告:'.$result->TITLE);
                 // Log::adminHandle('添加广告:'.$result->TITLE);
             });
             });
@@ -98,7 +98,7 @@ class AdController extends BaseController
     public function actionEdit(){
     public function actionEdit(){
         $id = Yii::$app->request->get('id');
         $id = Yii::$app->request->get('id');
         if(Yii::$app->request->isPost) {
         if(Yii::$app->request->isPost) {
-            return parent::edit(AdForm::class, 'Edit Ad Succeed', null, null, null, function($formModel, $result){
+            return parent::edit(AdForm::class, Yii::t('ctx', 'EditAdSuccessfully'), null, null, null, function($formModel, $result){
                 // 添加操作日志
                 // 添加操作日志
                 // Log::adminHandle('编辑广告:'.$result->TITLE);
                 // Log::adminHandle('编辑广告:'.$result->TITLE);
             });
             });
@@ -163,9 +163,9 @@ class AdController extends BaseController
             $formModel = new AdForm();
             $formModel = new AdForm();
             $formModel->scenario = 'sort';
             $formModel->scenario = 'sort';
             if($formModel->load(Yii::$app->request->get(), '') && $formModel->sortTo()){
             if($formModel->load(Yii::$app->request->get(), '') && $formModel->sortTo()){
-                return static::notice('Success');
+                return static::notice(Yii::t('ctx', 'successfully'));
             } else {
             } else {
-                return static::notice('Fail', 400);
+                return static::notice(Yii::t('ctx', 'failed'), 400);
             }
             }
         }
         }
     }
     }
@@ -180,9 +180,9 @@ class AdController extends BaseController
             $formModel = new AdForm();
             $formModel = new AdForm();
             $formModel->scenario = 'status';
             $formModel->scenario = 'status';
             if($formModel->load(Yii::$app->request->get(), '') && $formModel->statusTo()){
             if($formModel->load(Yii::$app->request->get(), '') && $formModel->statusTo()){
-                return static::notice('Success');
+                return static::notice(Yii::t('ctx', 'successfully'));
             } else {
             } else {
-                return static::notice('Fail', 400);
+                return static::notice(Yii::t('ctx', 'failed'), 400);
             }
             }
         }
         }
     }
     }
@@ -210,4 +210,4 @@ class AdController extends BaseController
             return static::notice($token);
             return static::notice($token);
         }
         }
     }
     }
-}
+}

+ 8 - 8
backendApi/modules/v1/controllers/ArticleController.php

@@ -45,7 +45,7 @@ class ArticleController extends BaseController
      */
      */
     public function actionCategoryAdd(){
     public function actionCategoryAdd(){
         if(Yii::$app->request->isPost) {
         if(Yii::$app->request->isPost) {
-            return parent::edit(ArticleCategoryForm::class, 'Successful');
+            return parent::edit(ArticleCategoryForm::class, Yii::t('ctx', 'successfully'));
         }
         }
     }
     }
 
 
@@ -70,9 +70,9 @@ class ArticleController extends BaseController
             $formModel = new ArticleCategoryForm();
             $formModel = new ArticleCategoryForm();
             $formModel->scenario = 'sort';
             $formModel->scenario = 'sort';
             if($formModel->load(Yii::$app->request->get(), '') && $formModel->sortTo()){
             if($formModel->load(Yii::$app->request->get(), '') && $formModel->sortTo()){
-                return static::notice('Successful');
+                return static::notice(Yii::t('ctx', 'successfully'));
             } else {
             } else {
-                return static::notice('Fail', 400);
+                return static::notice(Yii::t('ctx', 'failed'), 400);
             }
             }
         }
         }
     }
     }
@@ -99,7 +99,7 @@ class ArticleController extends BaseController
      */
      */
     public function actionAdd(){
     public function actionAdd(){
         if(Yii::$app->request->isPost) {
         if(Yii::$app->request->isPost) {
-            return parent::edit(ArticleForm::class, 'Successful');
+            return parent::edit(ArticleForm::class, Yii::t('ctx', 'successfully'));
         }
         }
         // 获取全部分类
         // 获取全部分类
         $allCategory = ArticleCategory::find()->where('STATUS=1')->asArray()->all();
         $allCategory = ArticleCategory::find()->where('STATUS=1')->asArray()->all();
@@ -115,7 +115,7 @@ class ArticleController extends BaseController
     public function actionEdit(){
     public function actionEdit(){
         $id = Yii::$app->request->get('id');
         $id = Yii::$app->request->get('id');
         if(Yii::$app->request->isPost){
         if(Yii::$app->request->isPost){
-            return parent::edit(ArticleForm::class, 'Successful');
+            return parent::edit(ArticleForm::class, Yii::t('ctx', 'successfully'));
         }
         }
         $oneData = Article::findOneAsArray(['ID'=>$id]);
         $oneData = Article::findOneAsArray(['ID'=>$id]);
         $oneData['CONTENT'] = is_resource($oneData['CONTENT']) ? stream_get_contents($oneData['CONTENT']) : '';
         $oneData['CONTENT'] = is_resource($oneData['CONTENT']) ? stream_get_contents($oneData['CONTENT']) : '';
@@ -231,10 +231,10 @@ class ArticleController extends BaseController
             $formModel = new ArticleForm();
             $formModel = new ArticleForm();
             $formModel->scenario = 'sort';
             $formModel->scenario = 'sort';
             if ($formModel->load(Yii::$app->request->get(), '') && $formModel->sortTo()) {
             if ($formModel->load(Yii::$app->request->get(), '') && $formModel->sortTo()) {
-                return static::notice('Success');
+                return static::notice(Yii::t('ctx', 'successfully'));
             } else {
             } else {
-                return static::notice('Fail', 400);
+                return static::notice(Yii::t('ctx', 'failed'), 400);
             }
             }
         }
         }
     }
     }
-}
+}

+ 11 - 11
backendApi/modules/v1/models/lists/log/AdminHandleList.php

@@ -47,7 +47,7 @@ class AdminHandleList extends \common\libs\dataList\DataList implements DataList
                 'save_before_content' => null,
                 'save_before_content' => null,
                 'save_after_content' => null,
                 'save_after_content' => null,
                 'opt_type' => [
                 'opt_type' => [
-                    'header' => '操作类型',
+                    'header' => \Yii::t('ctx', 'operatioType'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '200',
                         'width' => '200',
                     ],
                     ],
@@ -58,13 +58,13 @@ class AdminHandleList extends \common\libs\dataList\DataList implements DataList
                     },
                     },
                 ],
                 ],
                 'opt_obj_name' => [
                 'opt_obj_name' => [
-                    'header' => '操作对象编号',
+                    'header' => \Yii::t('ctx', 'operationObjectNumber'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '130',
                         'width' => '130',
                     ],
                     ],
                 ],
                 ],
                 'remark' => [
                 'remark' => [
-                    'header' => '备注',
+                    'header' => \Yii::t('ctx', 'remarks'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '120',
                         'width' => '120',
                         'show-overflow-tooltip'=>true,
                         'show-overflow-tooltip'=>true,
@@ -72,13 +72,13 @@ class AdminHandleList extends \common\libs\dataList\DataList implements DataList
                     ],
                     ],
                 ],
                 ],
                 'admin_name' => [
                 'admin_name' => [
-                    'header' => '操作人',
+                    'header' => \Yii::t('ctx', 'operator'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '130',
                         'width' => '130',
                     ],
                     ],
                 ],
                 ],
                 'created_at' => [
                 'created_at' => [
-                    'header' => '操作时间',
+                    'header' => \Yii::t('ctx', 'operatingTime'),
                     'value' => function($row) {
                     'value' => function($row) {
                         return (new DateTime([
                         return (new DateTime([
                             'value' => $row['created_at'],
                             'value' => $row['created_at'],
@@ -86,27 +86,27 @@ class AdminHandleList extends \common\libs\dataList\DataList implements DataList
                     },
                     },
                     'headerOther' => ['width' => '180'],
                     'headerOther' => ['width' => '180'],
                 ],
                 ],
-                'period_num' => '期数',
+                'period_num' =>  \Yii::t('ctx', 'numberOfPhases'),
                 'ip' => [
                 'ip' => [
-                    'header' => 'IP地址',
+                    'header' => \Yii::t('ctx', 'IPAddress'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '150',
                         'width' => '150',
                     ],
                     ],
                 ],
                 ],
                 'device' => [
                 'device' => [
-                    'header' => '客户端',
+                    'header' => \Yii::t('ctx', 'client'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '150',
                         'width' => '150',
                     ],
                     ],
                 ],
                 ],
                 'user_agent' => [
                 'user_agent' => [
-                    'header' => '操作系统',
+                    'header' => \Yii::t('ctx', 'operatingSystem'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '950',
                         'width' => '950',
                     ],
                     ],
                 ],
                 ],
                 'request_route' => [
                 'request_route' => [
-                    'header' => '请求路径',
+                    'header' => \Yii::t('ctx', 'requestPath'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '250',
                         'width' => '250',
                     ],
                     ],
@@ -172,4 +172,4 @@ class AdminHandleList extends \common\libs\dataList\DataList implements DataList
         }
         }
         return $this->filterTypes;
         return $this->filterTypes;
     }
     }
-}
+}

+ 23 - 23
backendApi/modules/v1/models/lists/log/SystemList.php

@@ -45,7 +45,7 @@ class SystemList extends \common\libs\dataList\DataList implements DataListInter
         if(!$this->columns){
         if(!$this->columns){
             $this->columns = [
             $this->columns = [
                 'opt_type' => [
                 'opt_type' => [
-                    'header' => '操作类型',
+                    'header' => \Yii::t('ctx', 'operatioType'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '120',
                         'width' => '120',
                     ],
                     ],
@@ -59,39 +59,39 @@ class SystemList extends \common\libs\dataList\DataList implements DataListInter
                     },
                     },
                 ],
                 ],
                 'opt_target_name' => [
                 'opt_target_name' => [
-                    'header' => '操作对象',
+                    'header' => \Yii::t('ctx', 'operatioObject'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '120',
                         'width' => '120',
                     ],
                     ],
                 ],
                 ],
                 'opt_obj_name' => [
                 'opt_obj_name' => [
-                    'header' => '对象编号',
+                    'header' => \Yii::t('ctx', 'objectNumber'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '110',
                         'width' => '110',
                     ],
                     ],
                 ],
                 ],
                 'request_content' => [
                 'request_content' => [
-                    'header' => '请求内容',
+                    'header' => \Yii::t('ctx', 'requestContent'),
                     'headerOther' => [
                     'headerOther' => [
                         'show-overflow-tooltip'=>true,
                         'show-overflow-tooltip'=>true,
                         'min-width'=>'250',
                         'min-width'=>'250',
                     ],
                     ],
                 ],
                 ],
                 'response_content' => [
                 'response_content' => [
-                    'header' => '返回内容',
+                    'header' => \Yii::t('ctx', 'requestContent'),
                     'headerOther' => [
                     'headerOther' => [
                         'show-overflow-tooltip'=>true,
                         'show-overflow-tooltip'=>true,
                         'min-width'=>'250',
                         'min-width'=>'250',
                     ],
                     ],
                 ],
                 ],
                 'opt_user' => [
                 'opt_user' => [
-                    'header' => '操作人',
+                    'header' => \Yii::t('ctx', 'operator'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '130',
                         'width' => '130',
                     ],
                     ],
                 ],
                 ],
                 'created_at' => [
                 'created_at' => [
-                    'header' => '操作时间',
+                    'header' => \Yii::t('ctx', 'operatingTime'),
                     'value' => function($row) {
                     'value' => function($row) {
                         return (new DateTime([
                         return (new DateTime([
                             'value' => $row['created_at'],
                             'value' => $row['created_at'],
@@ -99,27 +99,27 @@ class SystemList extends \common\libs\dataList\DataList implements DataListInter
                     },
                     },
                     'headerOther' => ['width' => '180'],
                     'headerOther' => ['width' => '180'],
                 ],
                 ],
-                'period_num' => '期数',
+                'period_num' => \Yii::t('ctx', 'numberOfPhases'),
                 'ip' => [
                 'ip' => [
-                    'header' => 'IP地址',
+                    'header' => \Yii::t('ctx', 'IPAddress'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '150',
                         'width' => '150',
                     ],
                     ],
                 ],
                 ],
                 'device' => [
                 'device' => [
-                    'header' => '客户端',
+                    'header' => \Yii::t('ctx', 'IPAddress'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '150',
                         'width' => '150',
                     ],
                     ],
                 ],
                 ],
                 'user_agent' => [
                 'user_agent' => [
-                    'header' => '操作系统',
+                    'header' =>  \Yii::t('ctx', 'operatingSystem'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '350',
                         'width' => '350',
                     ],
                     ],
                 ],
                 ],
                 'request_route' => [
                 'request_route' => [
-                    'header' => '请求路径',
+                    'header' => \Yii::t('ctx', 'requestPath'),
                     'headerOther' => [
                     'headerOther' => [
                         'width' => '250',
                         'width' => '250',
                     ],
                     ],
@@ -137,18 +137,18 @@ class SystemList extends \common\libs\dataList\DataList implements DataListInter
     {
     {
         if(!$this->filterTypes){
         if(!$this->filterTypes){
             $this->filterTypes = [
             $this->filterTypes = [
-                'opt_type' => ['isUserTable'=>false, 'name'=>'操作类型', 'other'=> 'select', 'selectData'=> [['id'=> 'call', 'name'=> '调用'], ['id'=> 'called', 'name'=> '被调用']]],
-                'opt_target_name' => ['isUserTable'=>false, 'name'=>'操作对象'],
-                'opt_obj_name' => ['isUserTable'=>false, 'name'=>'对象编号'],
-                'opt_user' => ['isUserTable'=>false, 'name'=>'操作人'],
-                'created_at' => ['isUserTable'=>false, 'name'=>'操作时间', 'other'=> 'date'],
-                'period_num' => ['isUserTable'=>false, 'name'=>'期数'],
-                'ip' => ['isUserTable'=>false, 'name'=>'IP地址'],
-                'device' => ['isUserTable'=>false, 'name'=>'客户端'],
-                'user_agent' => ['isUserTable'=>false, 'name'=>'操作系统'],
-                'request_route' => ['isUserTable'=>false, 'name'=>'请求路径'],
+                'opt_type' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'operatioType'), 'other'=> 'select', 'selectData'=> [['id'=> 'call', 'name'=> '调用'], ['id'=> 'called', 'name'=> '被调用']]],
+                'opt_target_name' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'operatingObject')],
+                'opt_obj_name' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'objectNumber')],
+                'opt_user' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'operator')],
+                'created_at' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'operatingTime'), 'other'=> 'date'],
+                'period_num' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'numberOfPhases')],
+                'ip' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'IPAddress')],
+                'device' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'client')],
+                'user_agent' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'operatingSystem')],
+                'request_route' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'requestPath')],
             ];
             ];
         }
         }
         return $this->filterTypes;
         return $this->filterTypes;
     }
     }
-}
+}

+ 10 - 4
common/libs/dataList/DataList.php

@@ -253,7 +253,9 @@ class DataList extends Model
                     }
                     }
                 } elseif(is_array($column)) {
                 } elseif(is_array($column)) {
                     if(!isset($column['header'])){
                     if(!isset($column['header'])){
-                        throw new Exception('column数组中必须存在header');
+                        //throw new Exception('column数组中必须存在header');
+                        $this->addError('header', \Yii::t('ctx', 'columnArrayMustExistHeader')); // 提交场景不存在
+                        return null;
                     }
                     }
                     if($key == 0){
                     if($key == 0){
                         if(!isset($column['hidden']) || !$column['hidden']){
                         if(!isset($column['hidden']) || !$column['hidden']){
@@ -425,11 +427,15 @@ class DataList extends Model
         } else {
         } else {
             $admin = Admin::findOneAsArray('ID=:ID', [':ID'=>$userId]);
             $admin = Admin::findOneAsArray('ID=:ID', [':ID'=>$userId]);
             if(!$admin){
             if(!$admin){
-                throw new Exception('管理员不存在');
+                //throw new Exception('管理员不存在');
+                $this->addError('admin', \Yii::t('ctx', 'adminUserDoesNotExist')); // 提交场景不存在
+                return null;
             }
             }
             $roleId = $admin['ROLE_ID'];
             $roleId = $admin['ROLE_ID'];
             if(!$roleId){
             if(!$roleId){
-                throw new Exception('管理组不存在');
+                //throw new Exception('管理组不存在');
+                $this->addError('roleid', \Yii::t('ctx', 'adminUserGroupDoesNotExist')); // 提交场景不存在
+                return null;
             }
             }
         }
         }
         // 如果是超级管理员直接返回不做处理
         // 如果是超级管理员直接返回不做处理
@@ -458,4 +464,4 @@ class DataList extends Model
             $this->columns = [];
             $this->columns = [];
         }
         }
     }
     }
-}
+}

+ 31 - 3
common/messages/en-US/ctx.php

@@ -78,6 +78,32 @@ return [
     'unableDelete' => 'Unable to delete',
     'unableDelete' => 'Unable to delete',
 
 
 
 
+    #Log
+    'adminUserDoesNotExist' => 'Admin User does not exist',
+    'adminUserGroupDoesNotExist' => 'Admin User Group does not exist',
+    'columnArrayMustExistHeader' => 'Column Array must exist Header',
+    'operatioType' => 'operatio type',
+    'operatingObject' => 'operatio object',
+    'objectNumber' => 'object number',
+    'requestContent' => 'request content',
+    'returnContent' => 'return content',
+    'operator' => 'operator',
+    'operatingTime' => 'operating time',
+    'numberOfPhases' => 'number of phases',
+    'IPAddress' => 'IP address',
+    'client' => 'client',
+    'operatingSystem' => 'operating system',
+    'requestPath' => 'request path',
+    'operationObjectNumber' => 'operation object number',
+    'remarks' => 'remarks',
+
+    #Ad
+    'AdAddedSuccessfully' => 'Add Ad Succeed',
+    'EditAdSuccessfully' => 'Edit Ad Succeed',
+
+    #Article
+    'articleNotExists' => 'Article not exists',
+
     # 公用
     # 公用
     'amountUnit' => '₦',
     'amountUnit' => '₦',
     'sceneDoesNotExist' => 'Scene does not exist',
     'sceneDoesNotExist' => 'Scene does not exist',
@@ -100,6 +126,8 @@ return [
     'illegalRequest' => 'Illegal request',
     'illegalRequest' => 'Illegal request',
     'invalidParameter' => 'Invalid Parameter',
     'invalidParameter' => 'Invalid Parameter',
     'dataDoesNotExists' => 'The data does not exist',
     'dataDoesNotExists' => 'The data does not exist',
+    'typeError' => 'Type error',
+    'contentError' => 'Content error',
 
 
 
 
     /**【以下内容为会员端词条,如果管理端有相同词条,移入分割线之上使用即可,翻译完全部项目之后删除以下内容】
     /**【以下内容为会员端词条,如果管理端有相同词条,移入分割线之上使用即可,翻译完全部项目之后删除以下内容】
@@ -287,7 +315,7 @@ return [
     'failedToGenerateMemberNumber' => 'Failed to generate member number',
     'failedToGenerateMemberNumber' => 'Failed to generate member number',
     'memberNumberDoesNotExist' => 'Member number does not exist',
     'memberNumberDoesNotExist' => 'Member number does not exist',
     'repeatSalesMemberNoDoesNotExist' => 'Repeat sales Member No. does not exist',
     'repeatSalesMemberNoDoesNotExist' => 'Repeat sales Member No. does not exist',
-    
+
     'memberDoesNotInSamePlacementNetwork' => 'The member is not in the same placement network as the current user',
     'memberDoesNotInSamePlacementNetwork' => 'The member is not in the same placement network as the current user',
     'viewSubMembersMost' => 'View the top 20 sub members of the member at most',
     'viewSubMembersMost' => 'View the top 20 sub members of the member at most',
     'upgradeMethodIncorrect' => 'The upgrade method is incorrect. Please contact the customer service personnel',
     'upgradeMethodIncorrect' => 'The upgrade method is incorrect. Please contact the customer service personnel',
@@ -375,7 +403,7 @@ return [
 
 
     # 登录
     # 登录
     'refreshTokenFailed' => 'refresh token failed',
     'refreshTokenFailed' => 'refresh token failed',
-    
+
     'accountDoesNotExist' => 'The account does not exist',
     'accountDoesNotExist' => 'The account does not exist',
     'memberNameOrPasswordIncorrect' => 'The member name or password is incorrect',
     'memberNameOrPasswordIncorrect' => 'The member name or password is incorrect',
     'abnormalMemberCode' => 'Abnormal member code',
     'abnormalMemberCode' => 'Abnormal member code',
@@ -395,4 +423,4 @@ return [
 
 
 
 
 
 
-];
+];

+ 30 - 3
common/messages/zh-CN/ctx.php

@@ -77,6 +77,32 @@ return [
     'modifyTransactionTypeCompleted' => '修改交易类型完成',
     'modifyTransactionTypeCompleted' => '修改交易类型完成',
     'unableDelete' => '无法删除',
     'unableDelete' => '无法删除',
 
 
+    #Log
+    'adminUserDoesNotExist'  => '管理员不存在',
+    'adminUserGroupDoesNotExist'  => '管理组不存在',
+    'columnArrayMustExistHeader'  => 'column数组中必须存在header',
+    'operatioType'  => '操作类型',
+    'operatingObject'  => '操作对象',
+    'objectNumber'  => '对象编号',
+    'requestContent'  => '请求内容',
+    'returnContent'  => '返回内容',
+    'operator'  => '操作人',
+    'operatingTime'  => '操作时间',
+    'numberOfPhases'  => '期数',
+    'IPAddress'  => 'IP地址',
+    'client'  => '客户端',
+    'operatingSystem'  => '操作系统',
+    'requestPath'  => '请求路径',
+    'operationObjectNumber'  => '操作对象编号',
+    'remarks'  => '备注',
+
+    #Ad
+    'AdAddedSuccessfully' => '广告添加成功',
+    'EditAdSuccessfully' => '广告编辑成功',
+
+    #Article
+    'articleNotExists'  => '文章不存在',
+
     # 公用
     # 公用
     'amountUnit' => '元',
     'amountUnit' => '元',
     'sceneDoesNotExist' => '场景不存在',
     'sceneDoesNotExist' => '场景不存在',
@@ -102,6 +128,8 @@ return [
     'illegalRequest' => '非法请求',
     'illegalRequest' => '非法请求',
     'invalidParameter' => '无效参数',
     'invalidParameter' => '无效参数',
     'dataDoesNotExists' => '数据不存在',
     'dataDoesNotExists' => '数据不存在',
+    'typeError' => '类型错误',
+    'contentError' => '内容错误',
 
 
 
 
     /**【以下内容为会员端词条,如果管理端有相同词条,移入分割线之上使用即可,翻译完全部项目之后删除以下内容】
     /**【以下内容为会员端词条,如果管理端有相同词条,移入分割线之上使用即可,翻译完全部项目之后删除以下内容】
@@ -291,7 +319,7 @@ return [
     'failedToGenerateMemberNumber' => '会员编号生成失败',
     'failedToGenerateMemberNumber' => '会员编号生成失败',
     'memberNumberDoesNotExist' => '会员编号不存在',
     'memberNumberDoesNotExist' => '会员编号不存在',
     'repeatSalesMemberNoDoesNotExist' => '复消会员编号不存在',
     'repeatSalesMemberNoDoesNotExist' => '复消会员编号不存在',
-    
+
     'memberDoesNotInSamePlacementNetwork' => '会员与当前用户不再同一安置网络内',
     'memberDoesNotInSamePlacementNetwork' => '会员与当前用户不再同一安置网络内',
     'viewSubMembersMost' => '最多查看会员的前20层子会员',
     'viewSubMembersMost' => '最多查看会员的前20层子会员',
     'upgradeMethodIncorrect' => '升级方式不正确,请联系客服人员',
     'upgradeMethodIncorrect' => '升级方式不正确,请联系客服人员',
@@ -384,7 +412,6 @@ return [
 
 
     # 登录
     # 登录
     'refreshTokenFailed' => '刷新token失败',
     'refreshTokenFailed' => '刷新token失败',
-    
     'wrongTransactionType' => '错误的交易类型',
     'wrongTransactionType' => '错误的交易类型',
     'accountDoesNotExist' => '账号不存在',
     'accountDoesNotExist' => '账号不存在',
     'memberNameOrPasswordIncorrect' => '用户名或密码错误',
     'memberNameOrPasswordIncorrect' => '用户名或密码错误',
@@ -398,4 +425,4 @@ return [
 
 
 
 
 
 
-];
+];

+ 3 - 3
common/models/forms/AdForm.php

@@ -96,7 +96,7 @@ class AdForm extends Model
      */
      */
     public function isType($attribute){
     public function isType($attribute){
         if(!in_array($this->type, [Ad::TYPE_LINK, Ad::TYPE_ARTICLE])){
         if(!in_array($this->type, [Ad::TYPE_LINK, Ad::TYPE_ARTICLE])){
-            $this->addError($attribute, 'Type error'); // 类型错误
+            $this->addError($attribute, \Yii::t('ctx', 'typeError')); // 类型错误
         }
         }
     }
     }
 
 
@@ -106,7 +106,7 @@ class AdForm extends Model
      */
      */
     public function isContent($attribute){
     public function isContent($attribute){
         if($this->content == ""){
         if($this->content == ""){
-            $this->addError($attribute, 'Content error'); // 内容错误
+            $this->addError($attribute, \Yii::t('ctx', 'contentError')); // 内容错误
         }
         }
     }
     }
 
 
@@ -132,7 +132,7 @@ class AdForm extends Model
                 $model->UPDATE_ADMIN = \Yii::$app->user->id;
                 $model->UPDATE_ADMIN = \Yii::$app->user->id;
                 $model->UPDATED_AT = Date::nowTime();
                 $model->UPDATED_AT = Date::nowTime();
             } else {
             } else {
-                $this->addError('edit', '提交场景不存在');
+                $this->addError('edit', \Yii::t('ctx', 'submissionDoesNotExist'));
                 return null;
                 return null;
             }
             }
             $model->TITLE = $this->title;
             $model->TITLE = $this->title;

+ 1 - 1
common/models/forms/ArticleForm.php

@@ -79,7 +79,7 @@ class ArticleForm extends Model
             }  elseif($this->scenario == 'sort') {
             }  elseif($this->scenario == 'sort') {
                 $model = Article::findOne(['ID'=>$this->id]);
                 $model = Article::findOne(['ID'=>$this->id]);
             } else {
             } else {
-                $this->addError('edit', 'Scenario not exists');// 提交场景不存在
+                $this->addError('edit', \Yii::t('ctx', 'sceneDoesNotExist'));// 提交场景不存在
                 return null;
                 return null;
             }
             }
             $model->TITLE = $this->title;
             $model->TITLE = $this->title;