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 }