From c05936e85e6592aa1d49f452b9727b7436087661 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Wed, 11 Dec 2019 14:18:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=A0=87=E9=99=90=E8=B4=AD=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=80=BC0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/controllers/GoodsController.php | 1 + ..._column_limit_count_in_table_atg_goods.php | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 backend/modules/goods/migrations/m191211_060934_update_column_limit_count_in_table_atg_goods.php diff --git a/backend/modules/goods/controllers/GoodsController.php b/backend/modules/goods/controllers/GoodsController.php index 5430eee..f132a10 100755 --- a/backend/modules/goods/controllers/GoodsController.php +++ b/backend/modules/goods/controllers/GoodsController.php @@ -102,6 +102,7 @@ class GoodsController extends Controller $model->is_taking = Goods::IS_TAKING_NO; $model->is_express = Goods::IS_EXPRESS_YES; $model->express_type = Goods::EXPRESS_TYPE_EXPRESS_TEMPLATE; + $model->limit_count = 0; if ($model->load(Yii::$app->request->post()) && $model->validate()) { //商品封面图和商品详情图上传保存处理 $res = GoodsManager::updateGoods(Yii::$app->request->post(), $model); diff --git a/backend/modules/goods/migrations/m191211_060934_update_column_limit_count_in_table_atg_goods.php b/backend/modules/goods/migrations/m191211_060934_update_column_limit_count_in_table_atg_goods.php new file mode 100644 index 0000000..b49fa9c --- /dev/null +++ b/backend/modules/goods/migrations/m191211_060934_update_column_limit_count_in_table_atg_goods.php @@ -0,0 +1,22 @@ +dropColumn('atg_goods', 'limit_count'); + $this->addColumn('atg_goods', 'limit_count', $this->integer(11)->defaultValue("0")->comment("限购数量")); + } + + public function down() + { + $this->dropColumn('atg_goods', 'limit_count'); + $this->addColumn('atg_goods', 'limit_count', $this->integer(11)->defaultValue(null)->comment("限购数量")); + return true; + } +}