Browse Source

商品列表多语言

root 2 years ago
parent
commit
a015a47481

+ 42 - 22
backendApi/modules/v1/models/lists/shop/GoodsList.php

@@ -38,15 +38,15 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
             $this->columns = [
                 'ID' => null,
                 'GOODS_NAME' => [
-                    'header' => 'Product Name', // 商品名称
+                    'header' => \Yii::t('ctx', 'shopListProductName'), // 商品名称
                     'headerOther' => ['width' => '200'],
                 ],
                 'GOODS_NO' => [
-                    'header' => 'Products Code', // 商品编号
+                    'header' => \Yii::t('ctx', 'shopListProductsCode'), // 商品编号
                     'headerOther' => ['width' => '200'],
                 ],
                 'SELL_DISCOUNT' => [
-                    'header' => 'Discount Rate', // 商品折扣
+                    'header' => \Yii::t('ctx', 'shopListDiscountRate'), // 商品折扣
                     'value' => function($row) {
                         $discount = 0;
                         if ($row['TYPE'] == 1) {
@@ -62,7 +62,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                     'headerOther' => ['width' => '150'],
                 ],
                 'GIFT_TYPE' => [
-                    'header' => 'Products Type', // 商品类型
+                    'header' => \Yii::t('ctx', 'shopListProductsType'), // 商品类型
                     'value' => function($row){
                         $giftType = ShopGoods::GIFT_TYPE;
                         $gift = explode(',',$row['GIFT_TYPE']);
@@ -76,7 +76,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                     'headerOther' => ['width' => '150'],
                 ],
                 'CATEGORY_TYPE' => [
-                    'header' => 'Product Category', // 商品分类
+                    'header' => \Yii::t('ctx', 'shopListProductCategory'), // 商品分类
                     'value' => function($row) {
                         $categoryType = array_column(ShopGoods::CATEGORY_TYPE, NULL, 'id');
                         return $categoryType[$row['CATEGORY_TYPE']]['name'] ?? '';
@@ -84,7 +84,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                     'headerOther' => ['width' => '150'],
                 ],
                 'SELL_TYPE' => [
-                    'header' => 'Payment Mode', // 购买方式
+                    'header' => \Yii::t('ctx', 'shopListPaymentMode'), // 购买方式
                     'value' => function($row){
                         $sellType = ShopGoods::SALE_TYPE;
                         $sel = explode(',',$row['SELL_TYPE']);
@@ -97,7 +97,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                     'headerOther' => ['width' => '150'],
                 ],
                 'SELL_PRICE_STANDARD' => [
-                    'header' => 'US Price($)', // 标准价格($)
+                    'header' => \Yii::t('ctx', 'shopListPriceStandard'), // 标准价格($)
                     'headerOther' => [
                         'width' => '150',
                     ],
@@ -111,7 +111,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                 ],
                 'SELL_PRICE' => [
-                    'header' => 'Sales Price(₦)', // 商品价格
+                    'header' => \Yii::t('ctx', 'shopListSellPrice'), // 商品价格
                     'headerOther' => [
                         'width' => '150',
                     ],
@@ -125,7 +125,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                 ],
                 'PRICE_PV' => [
-                    'header' => 'Products BV', // 产品BV
+                    'header' => \Yii::t('ctx', 'shopListProductsBv'), // 产品BV
                     'headerOther' => [
                         'width' => '150',
                     ],
@@ -139,7 +139,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                 ],
                 'TAX_RATE' => [
-                    'header' => 'Tax Rate(%)', // 税率
+                    'header' => \Yii::t('ctx', 'shopListTaxRate'), // 税率
                     'headerOther' => [
                         'width' => '150',
                     ],
@@ -153,7 +153,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                 ],
                 'TAX' => [
-                    'header' => 'Tax(₦)', // 税额
+                    'header' => \Yii::t('ctx', 'shopListTax'), // 税额
                     'headerOther' => [
                         'width' => '150',
                     ],
@@ -167,22 +167,22 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                 ],
                 'STORE_NUMS' => [
-                    'header' => 'Inventory', // 库存
+                    'header' => \Yii::t('ctx', 'shopListInventory'), // 库存
                     'headerOther' => [
                         'width' => '110',
                     ],
                 ],
                 'STATUS' => [
-                    'header' => 'Status', // 状态
+                    'header' => \Yii::t('ctx', 'shopListStatus'), // 状态
                     'value' => function($row) {
-                        return $row['STATUS'] == 1 ? 'On sale' : 'Sold out'; //已上架:已下架
+                        return $row['STATUS'] == 1 ? \Yii::t('ctx', 'shopListOnSale') : \Yii::t('ctx', 'shopListSoldOut'); //已上架:已下架
                     },
                     'headerOther' => [
                         'width' => '110',
                     ],
                 ],
                 'UPDATED_AT' => [
-                    'header' => 'Update Time', // 更新时间
+                    'header' => \Yii::t('ctx', 'shopListUpdatedAt'), // 更新时间
                     'value' => function ($row) {
                         return (new DateTime([
                             'value' => $row['UPDATED_AT'],
@@ -203,13 +203,33 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
     {
         if(!$this->filterTypes){
             $this->filterTypes = [
-                'GIFT_TYPE' => ['isUserTable' => false, 'name' => 'Products Type', 'other' => 'select', 'selectData' => [['id' => 1, 'name' => 'Entry area'], ['id' => 2, 'name' => 'Reselling area'], ['id' => 3, 'name' => 'Office Entry area'], ['id' => 4, 'name' => 'Office Reselling area']]],
-                'STATUS'=> ['name'=> 'Status', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> 'Sold out'],['id'=> 1, 'name'=> 'On sale']]], // 状态,已下架,已上架
-                'GOODS_NAME'=> ['name'=> 'Product Name'], // 商品名称
-                'GOODS_NO'=> ['name'=> 'Products Code'], // 商品编号
-                'SELL_PRICE'=> ['name'=> 'Products Price'], // 销售价格
-                'PRICE_PV'=> ['name'=> 'Products BV'], // 销售PV
-                'CATEGORY_TYPE' => ['name' => 'Product Category', 'other'=> 'select', 'selectData'=> ShopGoods::CATEGORY_TYPE], // 商品分类
+                'GIFT_TYPE' => [
+                    'isUserTable' => false, 
+                    'name' => \Yii::t('ctx', 'shopListProductsType'), 
+                    'other' => 'select', 
+                    'selectData' => [
+                        ['id' => 1, 'name' => \Yii::t('ctx', 'shopList1stPurchase')], 
+                        ['id' => 2, 'name' => \Yii::t('ctx', 'shopListRepeatPurchase')], 
+                        ['id' => 3, 'name' => \Yii::t('ctx', 'shopListEntryArea')], 
+                        ['id' => 4, 'name' => \Yii::t('ctx', 'shopListResellingArea')]
+                    ]
+                ],
+                'STATUS'=> [
+                    'name'=> \Yii::t('ctx', 'shopListStatus'), 'other'=> 'select', 
+                    'selectData'=> [
+                        ['id'=> 0, 'name'=> \Yii::t('ctx', 'shopListSoldOut')],
+                        ['id'=> 1, 'name'=> \Yii::t('ctx', 'shopListOnSale')]
+                    ]
+                ], // 状态,已下架,已上架
+                'GOODS_NAME'=> ['name'=> \Yii::t('ctx', 'shopListProductName')], // 商品名称
+                'GOODS_NO'=> ['name'=> \Yii::t('ctx', 'shopListProductsCode')], // 商品编号
+                'SELL_PRICE'=> ['name'=> \Yii::t('ctx', 'shopListSellPrice')], // 销售价格
+                'PRICE_PV'=> ['name'=> \Yii::t('ctx', 'shopListProductsBv')], // 销售PV
+                'CATEGORY_TYPE' => [
+                    'name' => \Yii::t('ctx', 'shopListProductCategory'), 
+                    'other'=> 'select', 
+                    'selectData'=> ShopGoods::CATEGORY_TYPE
+                ], // 商品分类
             ];
         }
         return $this->filterTypes;

+ 1 - 1
backendApi/modules/v1/models/lists/shop/OrderList.php

@@ -354,7 +354,7 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                 ],
                 'IS_AUTO' => [
-                    'header' => 'Is Auto', // 是否自动
+                    'header' => \Yii::t('ctx', 'shopOrderListIsAuto'), // 是否自动
                     'value' => function ($row) {
                         return $row['IS_AUTO'] == 1 ? \Yii::t('ctx', 'shopOrderListIsAutoYes') : \Yii::t('ctx', 'shopOrderListIsAutoNo');
                     },

+ 21 - 0
common/messages/en-US/ctx.php

@@ -170,6 +170,27 @@ return [
     'placementMemberName' => 'Placement Member Name',
 
     #Products management
+    'shopListProductName' => 'Product Name',
+    'shopListProductsCode' => 'Products Code',
+    'shopListDiscountRate' => 'Discount Rate',
+    'shopListProductsType' => 'Products Type',
+    'shopListProductCategory' => 'Product Category',
+    'shopListPaymentMode' => 'Payment Mode',
+    'shopListPriceStandard' => 'US Price($)',
+    'shopListSellPrice' => 'Sales Price(₦)',
+    'shopListProductsBv' => 'Products BV',
+    'shopListTaxRate' => 'Tax Rate(%)',
+    'shopListTax' => 'Tax(₦)',
+    'shopListInventory' => 'Inventory',
+    'shopListStatus' => 'Status',
+    'shopListOnSale' => 'On sale',
+    'shopListSoldOut' => 'Sold out',
+    'shopListUpdatedAt' => 'Update Time',
+    'shopListEntryArea' => 'Entry area',
+    'shopListResellingArea' => 'Reselling area',
+    'shopList1stPurchase' => '1st Purchase',
+    'shopListRepeatPurchase' => 'Repeat Purchase',
+
     'shopExportListName' => 'Goods_List',
     'shopProductAddSucceededNotice' => 'Product add succeeded',
     'shopProductEditSucceed'=>'Product editing succeeded',

+ 22 - 0
common/messages/zh-CN/ctx.php

@@ -170,6 +170,28 @@ return [
     'placementMemberName' => '安置会员姓名',
 
     #商品管理
+    'shopListProductName' => '商品名称',
+    'shopListProductsCode' => '商品编号',
+    'shopListDiscountRate' => '商品折扣',
+    'shopListProductsType' => '商品类型',
+    'shopListProductCategory' => '商品分类',
+    'shopListPaymentMode' => '购买方式',
+    'shopListPriceStandard' => '标准价格($)',
+    'shopListSellPrice' => '商品价格',
+    'shopListProductsBv' => '产品BV',
+    'shopListTaxRate' => '税率(%)',
+    'shopListTax' => '税额(₦)',
+    'shopListInventory' => '库存',
+    'shopListStatus' => '状态',
+    'shopListOnSale' => '已上架',
+    'shopListSoldOut' => '已下架',
+    'shopListUpdatedAt' => '更新时间',
+    'shopListEntryArea' => '工作室报单',
+    'shopListResellingArea' => '工作室复消',
+    'shopList1stPurchase' => '报单区',
+    'shopListRepeatPurchase' => '复消区',
+    
+
     'shopExportListName' => '商品列表',
     'shopProductAddSucceededNotice' => '商品添加成功',
     'shopProductEditSucceed'=>'商品编辑成功',