From acd6c94b30f81545130bd2c6fbd4afd9ad15d2e0 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Wed, 11 Dec 2019 14:23:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=95=86=E5=93=81=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A1=8C=E4=B8=BA=EF=BC=8C=E8=8B=A5limit=5Fc?= =?UTF-8?q?ount=E5=AD=97=E6=AE=B5=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=88=99?= =?UTF-8?q?=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/goods/controllers/GoodsController.php | 1 - backend/modules/goods/models/ars/Goods.php | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/modules/goods/controllers/GoodsController.php b/backend/modules/goods/controllers/GoodsController.php index f132a10..5430eee 100755 --- a/backend/modules/goods/controllers/GoodsController.php +++ b/backend/modules/goods/controllers/GoodsController.php @@ -102,7 +102,6 @@ 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/models/ars/Goods.php b/backend/modules/goods/models/ars/Goods.php index 390587e..e23312f 100755 --- a/backend/modules/goods/models/ars/Goods.php +++ b/backend/modules/goods/models/ars/Goods.php @@ -234,6 +234,9 @@ class Goods extends \yii\db\ActiveRecord if (!$this->sn) { $this->sn = time() . rand(1111, 9999); } + if (!$this->limit_count) { + $this->limit_count = 0; + } return parent::beforeSave($insert); // TODO: Change the autogenerated stub }