Przeglądaj źródła

商品下架提示文案修改;新增BA级别

kevin_zhangl 2 lat temu
rodzic
commit
b017692f62

+ 1 - 0
common/messages/en-US/app.php

@@ -28,6 +28,7 @@ return [
     'insufficientInventory' => 'Insufficient inventory',
     'soldOut' => 'Sold out',
     'productsDoesNotExists' => 'Products does not exists!',
+    'productsDoesSoldOut' => 'Products has sold out!',
     'cashDoesNotAdequate' => '余额不足,无法购买商品',
     'exchangePointDoesNotAdequate' => '兑换积分不足,无法购买商品',
     'travelPointDoesNotAdequate' => '旅游积分不足,无法购买商品',

+ 1 - 0
common/messages/zh-CN/app.php

@@ -28,6 +28,7 @@ return [
     'insufficientInventory' => '库存不足',
     'soldOut' => '已下架',
     'productsDoesNotExists' => '商品不存在',
+    'productsDoesSoldOut' => '商品已下架',
     'cashDoesNotAdequate' => '余额不足,无法购买商品',
     'exchangePointDoesNotAdequate' => '兑换积分不足,无法购买商品',
     'travelPointDoesNotAdequate' => '旅游积分不足,无法购买商品',

+ 2 - 2
common/models/forms/ApproachDeclarationLoopForm.php

@@ -122,7 +122,7 @@ class ApproachDeclarationLoopForm extends Model
                 if (isset($value['packageId']) && $value['packageId']){
                     $packagedata = DeclarationPackage::findOneAsArray('ID=:ID', [':ID' => $value['packageId']]);
                     if (!$packagedata) {
-                        throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                        throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                     }
                     if($packagedata['STORE_NUMS']>0){
                         $data =  DeclarationPackage::find()->where(['ID'=> $packagedata['ID'] ])->one();
@@ -144,7 +144,7 @@ class ApproachDeclarationLoopForm extends Model
                     for ($i = 0; $i < count($value['goodsId']) ;$i++) {
                         $goods = ShopGoods::findOneAsArray('ID=:ID',[':ID'=> $value['goodsId'][$i]]);
                         if (!$goods) {
-                            throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                            throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                         }
                         if ($goods['STATUS'] == 1 ){
                             if($goods['STORE_NUMS'] >= $value['goodsNum'][$i]) {

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

@@ -415,7 +415,7 @@ class ApproachOrderForm extends Model
             if ($v) {
                 $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
                 if (!$goods) {
-                    throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                    throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                 }
                 if($goods['STORE_NUMS']>0){
                     if ($goods['TYPE'] == 1 || $goods['TYPE'] == 2) {

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

@@ -121,7 +121,7 @@ class BaApproachDeclarationLoopForm extends Model
                 if (isset($value['packageId']) && $value['packageId']){
                     $packagedata = DeclarationPackage::findOneAsArray('ID=:ID', [':ID' => $value['packageId']]);
                     if (!$packagedata) {
-                        throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                        throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                     }
                     if($packagedata['STORE_NUMS']>0){
                         $data =  DeclarationPackage::find()->where(['ID'=> $packagedata['ID'] ])->one();

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

@@ -355,7 +355,7 @@ class BaApproachOrderForm extends Model
             if ($v) {
                 $goods = ShopGoods::findOneAsArray('ID = :ID AND STATUS = 1', [':ID' => $ids[$k]]);
                 if (!$goods) {
-                    throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                    throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                 }
                 if ($goods['STORE_NUMS'] > 0) {
                     if ($goods['TYPE'] == 1 || $goods['TYPE'] == 2) {

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

@@ -120,7 +120,7 @@ class BaDeclarationLoopForm extends Model
                     for ($i=0;$i<count($value['goodsId']);$i++){
                         $goods = ShopGoods::findOneAsArray('ID=:ID',[':ID'=> $value['goodsId'][$i]]);
                         if (!$goods) {
-                            throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                            throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                         }
                         if ($goods['STATUS'] == 1 ){
                             if($goods['STORE_NUMS'] >= $value['goodsNum'][$i]){

+ 2 - 2
common/models/forms/DeclarationLoopForm.php

@@ -127,7 +127,7 @@ class DeclarationLoopForm extends Model
 
                     $packagedata = DeclarationPackage::findOneAsArray('ID=:ID', [':ID' => $value['packageId']]);
                     if (!$packagedata) {
-                        throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                        throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                     }
                     //var_dump($packagedata['ID']);
                     if($packagedata['STORE_NUMS']<=0){
@@ -139,7 +139,7 @@ class DeclarationLoopForm extends Model
                     for ($i=0;$i<count($value['goodsId']);$i++){
                         $goods = ShopGoods::findOneAsArray('ID=:ID',[':ID'=> $value['goodsId'][$i]]);
                         if (!$goods) {
-                            throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                            throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                         }
                         if ($goods['STATUS'] == 1 ){
                             if($goods['STORE_NUMS'] < $value['goodsNum'][$i]){

+ 4 - 4
common/models/forms/OrderForm.php

@@ -227,7 +227,7 @@ class OrderForm extends Model
         // 一个订单只能包含一类商品
         $goods = ShopGoods::find()->select('ID,CATEGORY_TYPE')->where(['in', 'ID', $this->goodsId])->andWhere(['STATUS' => 1])->asArray()->all();
         if (!$goods) {
-            throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+            throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
             return;
         }
         $goodsCategoryType = array_unique(array_column($goods, 'CATEGORY_TYPE'));
@@ -468,7 +468,7 @@ class OrderForm extends Model
             if ($v) {
                 $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
                 if (!$goods) {
-                    throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                    throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                 }
                 if($goods['STORE_NUMS']>0){
                     if ($goods['TYPE'] == 1 || $goods['TYPE'] == 2) {
@@ -570,7 +570,7 @@ class OrderForm extends Model
                 if ($v){
                     $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
                     if (!$goods) {
-                        throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                        throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                     }
                     if ($goods['STORE_NUMS'] >= $this->goodsNum[$k]){
                         $data = ShopGoods::find()->where(['ID' => $ids[$k]])->one();
@@ -876,7 +876,7 @@ class OrderForm extends Model
                 if ($v){
                     $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
                     if (!$goods) {
-                        throw new Exception(Yii::t('app', 'productsDoesNotExists'));
+                        throw new Exception(Yii::t('app', 'productsDoesSoldOut'));
                     }
                     if ($goods['STORE_NUMS'] >= $this->goodsNum[$k]){
                         $data = ShopGoods::find()->where(['ID' => $ids[$k]])->one();

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

@@ -240,7 +240,7 @@ class UserForm extends Model
      */
     public function isMinDecLevel($attribute, $params){
         // 获取排序为2的报单级别
-        $decLevel = DeclarationLevel::getLevelFromSort(2);
+        $decLevel = DeclarationLevel::getLevelFromSort(1);
         if($this->zcPv < $decLevel['PERF']){
             $this->addError($attribute, '注册'.$this->userName.'时,注册PV低于最低级别要求,不能报首购单');
         }