|
|
@@ -64,7 +64,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
|
|
|
'GIFT_TYPE' => [
|
|
|
'header' => \Yii::t('ctx', 'shopListProductsType'), // 商品类型
|
|
|
'value' => function($row){
|
|
|
- $giftType = ShopGoods::GIFT_TYPE;
|
|
|
+ $giftType = $this->getGiftType();//ShopGoods::GIFT_TYPE;
|
|
|
$gift = explode(',',$row['GIFT_TYPE']);
|
|
|
$value = '';
|
|
|
foreach ($gift as $v){
|
|
|
@@ -78,7 +78,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
|
|
|
'CATEGORY_TYPE' => [
|
|
|
'header' => \Yii::t('ctx', 'shopListProductCategory'), // 商品分类
|
|
|
'value' => function($row) {
|
|
|
- $categoryType = array_column(ShopGoods::CATEGORY_TYPE, NULL, 'id');
|
|
|
+ $categoryType = array_column($this->getCategoryType(), NULL, 'id'); //array_column(ShopGoods::CATEGORY_TYPE, NULL, 'id');
|
|
|
return $categoryType[$row['CATEGORY_TYPE']]['name'] ?? '';
|
|
|
},
|
|
|
'headerOther' => ['width' => '150'],
|
|
|
@@ -86,7 +86,7 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
|
|
|
'SELL_TYPE' => [
|
|
|
'header' => \Yii::t('ctx', 'shopListPaymentMode'), // 购买方式
|
|
|
'value' => function($row){
|
|
|
- $sellType = ShopGoods::SALE_TYPE;
|
|
|
+ $sellType = $this->getSaleType(); //ShopGoods::SALE_TYPE;
|
|
|
$sel = explode(',',$row['SELL_TYPE']);
|
|
|
$value = '';
|
|
|
foreach ($sel as $v){
|
|
|
@@ -228,10 +228,104 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
|
|
|
'CATEGORY_TYPE' => [
|
|
|
'name' => \Yii::t('ctx', 'shopListProductCategory'),
|
|
|
'other'=> 'select',
|
|
|
- 'selectData'=> ShopGoods::CATEGORY_TYPE
|
|
|
+ // 翻译无法使用const,改成其他方式
|
|
|
+ // 'selectData'=> ShopGoods::CATEGORY_TYPE
|
|
|
+ 'selectData'=> $this->getCategoryType()
|
|
|
], // 商品分类
|
|
|
];
|
|
|
}
|
|
|
return $this->filterTypes;
|
|
|
}
|
|
|
+
|
|
|
+ public function getCategoryType() {
|
|
|
+ $saleType = $this->getSaleType();
|
|
|
+ return [
|
|
|
+ [
|
|
|
+ 'id' => 1,
|
|
|
+ 'name' => \Yii::t('ctx', 'shopListStandardProducts'),//普通商品
|
|
|
+ 'sell_type' => [
|
|
|
+ $saleType[1],
|
|
|
+ // self::SALE_TYPE[3],
|
|
|
+ $saleType[7],
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ // [
|
|
|
+ // 'id' => 4,
|
|
|
+ // 'name' => 'Travel bonus products',//旅游积分商品
|
|
|
+ // 'sell_type' => [
|
|
|
+ // self::SALE_TYPE[4]
|
|
|
+ // ]
|
|
|
+ // ],
|
|
|
+ [
|
|
|
+ 'id' => 5,
|
|
|
+ 'name' => \Yii::t('ctx', 'shopListCarFundProducts'),
|
|
|
+ 'sell_type' => [
|
|
|
+ $saleType[5]
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'id' => 6,
|
|
|
+ 'name' => \Yii::t('ctx', 'shopListVillaFundProducts'),
|
|
|
+ 'sell_type' => [
|
|
|
+ $saleType[6]
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getSaleType() {
|
|
|
+ return [
|
|
|
+ 1 => [
|
|
|
+ 'id' => 1,
|
|
|
+ 'name' => \Yii::t('ctx', 'shopListAccountBalance'), //余额购买
|
|
|
+ 'label' => 'cash',
|
|
|
+ ],
|
|
|
+ // 2 => [
|
|
|
+ // 'id' => 2,
|
|
|
+ // 'name' => '复消兑换',
|
|
|
+ // ],
|
|
|
+ // 3 => [
|
|
|
+ // 'id' => 3,
|
|
|
+ // 'name' => '兑换点数',
|
|
|
+ // 'label' => 'exchange',
|
|
|
+ // ],
|
|
|
+ 4 => [
|
|
|
+ 'id' => 4,
|
|
|
+ 'name' => \Yii::t('ctx', 'shopListPayTravelBonus'), // 旅游积分
|
|
|
+ 'label' => 'tourism_points',
|
|
|
+ ],
|
|
|
+ 5 => [
|
|
|
+ 'id' => 5,
|
|
|
+ 'name' => \Yii::t('ctx', 'shopListPayCarFund'), // 车奖积分
|
|
|
+ 'label' => 'garage_points',
|
|
|
+ ],
|
|
|
+ 6 => [
|
|
|
+ 'id' => 6,
|
|
|
+ 'name' => \Yii::t('ctx', 'shopListPayVillaFund'), // 房奖积分
|
|
|
+ 'label' => 'villa_points',
|
|
|
+ ],
|
|
|
+ 7 => [
|
|
|
+ 'id' => 7,
|
|
|
+ 'name' => 'PayStack', // PayStack
|
|
|
+ 'label' => 'pay_stack',
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getGiftType() {
|
|
|
+ return [
|
|
|
+ 1 =>[
|
|
|
+ 'name'=>\Yii::t('ctx', 'shopList1stPurchase'),//报单区
|
|
|
+ ],
|
|
|
+ 2 =>[
|
|
|
+ 'name'=>\Yii::t('ctx', 'shopListRepeatPurchase'),//复消区
|
|
|
+ ],
|
|
|
+ 3 =>[
|
|
|
+ 'name'=>\Yii::t('ctx', 'shopListEntryArea')//'Office Entry area',//工作室报单
|
|
|
+ ],
|
|
|
+ 4 =>[
|
|
|
+ 'name'=>\Yii::t('ctx', 'shopListResellingArea')//'Office Reselling area',//工作室复消
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ }
|
|
|
}
|