From 2dc5dad41085555cd3ad2ca836db1c58607eaef9 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Fri, 13 Dec 2019 09:49:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E5=90=8E=E5=8F=B0=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=8E=92=E5=BA=8F=E5=A2=9E=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/goods/models/ars/Category.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/modules/goods/models/ars/Category.php b/backend/modules/goods/models/ars/Category.php index 16bf72f..e32fd7c 100755 --- a/backend/modules/goods/models/ars/Category.php +++ b/backend/modules/goods/models/ars/Category.php @@ -112,4 +112,12 @@ class Category extends \yii\db\ActiveRecord { return $this->hasOne(File::className(), ['id' => 'icon']); } + + public function beforeSave($insert) + { + if (!$this->sort_order) { + $this->sort_order = "999"; + } + return parent::beforeSave($insert); // TODO: Change the autogenerated stub + } }