소스 검색

商品属性编辑

kevin 1 년 전
부모
커밋
82aa0a76d2

+ 1 - 0
backendApi/config/urlManagerRules.php

@@ -39,6 +39,7 @@ return [
         'controller' => 'v1/shop',
         'extraPatterns' => [
             'GET index' => 'index',
+            'GET goods-nature' => 'goods-nature',
             'GET goods-list-export' => 'goods-list-export',
             'GET,POST goods-add' => 'goods-add',
             'GET,POST goods-edit' => 'goods-edit',

+ 12 - 2
backendApi/modules/v1/controllers/ShopController.php

@@ -37,6 +37,7 @@ use common\models\forms\UploadForm;
 use common\models\Order;
 use common\models\Period;
 use common\models\ShopGoods;
+use common\models\ShopGoodsNature;
 use Yii;
 use yii\web\HttpException;
 use yii\web\UploadedFile;
@@ -65,7 +66,6 @@ class ShopController extends BaseController {
             'GOODS_NAME'=> 'GOODS_NAME',
             'GOODS_NO'=> 'GOODS_NO',
             'SELL_TYPE'=> 'SELL_TYPE',
-            'SELL_PRICE'=> 'SELL_PRICE',
             'PRICE_PV'=> 'PRICE_PV',
             'CATEGORY_TYPE' => 'CATEGORY_TYPE',
         ]);
@@ -77,6 +77,17 @@ class ShopController extends BaseController {
         return static::notice($data);
     }
 
+    /**
+     * 商品属性
+     * @return mixed
+     * @throws Exception
+     * @throws HttpException
+     */
+    public function actionGoodsNature() {
+        $data = ShopGoodsNature::findAllAsArray('GOODS_ID=:GOODS_ID', [':GOODS_ID' => \Yii::$app->request->get('GOOD_ID')]);
+        return static::notice($data);
+    }
+
     /**
      * 商品列表导出
      * @return mixed
@@ -92,7 +103,6 @@ class ShopController extends BaseController {
             'GOODS_NAME'=> 'GOODS_NAME',
             'GOODS_NO'=> 'GOODS_NO',
             'SELL_TYPE'=> 'SELL_TYPE',
-            'SELL_PRICE'=> 'SELL_PRICE',
             'PRICE_PV'=> 'PRICE_PV',
             'CATEGORY_TYPE' => 'CATEGORY_TYPE',
         ]);

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

@@ -5,6 +5,7 @@ use common\helpers\Tool;
 use common\libs\dataList\DataListInterface;
 use common\models\ShopGoods;
 use common\libs\dataList\column\DateTime;
+use common\models\ShopGoodsNature;
 
 class GoodsList extends \common\libs\dataList\DataList implements DataListInterface
 {
@@ -110,20 +111,6 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                         ];
                     },
                 ],
-                'SELL_PRICE' => [
-                    'header' => \Yii::t('ctx', 'shopListSellPrice'), // 商品价格
-                    'headerOther' => [
-                        'width' => '150',
-                    ],
-                    'value' => function ($row) {
-                        return Tool::formatPrice($row['SELL_PRICE']);
-                    },
-                    'valueOther' => function ($row) {
-                        return [
-                            'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
-                        ];
-                    },
-                ],
                 'PRICE_PV' => [
                     'header' => \Yii::t('ctx', 'shopListProductsBv'), // 产品BV
                     'headerOther' => [
@@ -138,34 +125,6 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                         ];
                     },
                 ],
-//                'TAX_RATE' => [
-//                    'header' => \Yii::t('ctx', 'shopListTaxRate'), // 税率
-//                    'headerOther' => [
-//                        'width' => '150',
-//                    ],
-//                    'value' => function ($row) {
-//                        return Tool::formatPrice($row['TAX_RATE']);
-//                    },
-//                    'valueOther' => function ($row) {
-//                        return [
-//                            'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
-//                        ];
-//                    },
-//                ],
-//                'TAX' => [
-//                    'header' => \Yii::t('ctx', 'shopListTax'), // 税额
-//                    'headerOther' => [
-//                        'width' => '150',
-//                    ],
-//                    'value' => function ($row) {
-//                        return Tool::formatPrice($row['SELL_PRICE'] - $row['SELL_PRICE'] / (1 + $row['TAX_RATE'] / 100));
-//                    },
-//                    'valueOther' => function ($row) {
-//                        return [
-//                            'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
-//                        ];
-//                    },
-//                ],
                 'STORE_NUMS' => [
                     'header' => \Yii::t('ctx', 'shopListInventory'), // 库存
                     'headerOther' => [
@@ -223,7 +182,6 @@ class GoodsList extends \common\libs\dataList\DataList implements DataListInterf
                 ], // 状态,已下架,已上架
                 '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'),