From 667865d42310061844a0902f29383e8150606382 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Mon, 2 Dec 2019 14:09:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E8=A1=A8?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...olumn_sort_order_in_antgoods_attribute.php | 43 ------------------- ...column_sort_order_in_antgoods_category.php | 43 ------------------- .../goods/src/models/ars/Attribute.php | 16 ------- .../goods/src/models/ars/Category.php | 16 ------- .../antgoods/goods/src/views/goods/goods.php | 6 +++ 5 files changed, 6 insertions(+), 118 deletions(-) delete mode 100644 vendor/antgoods/goods/src/migrations/m191202_025843_update_column_sort_order_in_antgoods_attribute.php delete mode 100644 vendor/antgoods/goods/src/migrations/m191202_032835_update_column_sort_order_in_antgoods_category.php diff --git a/vendor/antgoods/goods/src/migrations/m191202_025843_update_column_sort_order_in_antgoods_attribute.php b/vendor/antgoods/goods/src/migrations/m191202_025843_update_column_sort_order_in_antgoods_attribute.php deleted file mode 100644 index 6757320..0000000 --- a/vendor/antgoods/goods/src/migrations/m191202_025843_update_column_sort_order_in_antgoods_attribute.php +++ /dev/null @@ -1,43 +0,0 @@ -dropColumn('antgoods_attribute', 'sort_order'); - $this->addColumn('antgoods_attribute', 'sort_order', $this->smallInteger(3)->defaultValue(null)->unsigned()->comment('排序')); - } - - /** - * {@inheritdoc} - */ - public function safeDown() - { - $this->dropColumn('antgoods_attribute', 'sort_order'); - $this->addColumn('antgoods_attribute', 'sort_order', $this->smallInteger(3)->defaultValue(null)->comment('排序')); - return true; - } - - /* - // Use up()/down() to run migration code without a transaction. - public function up() - { - - } - - public function down() - { - echo "m191202_025843_update_column_sort_order_in_antgoods_attribute cannot be reverted.\n"; - - return false; - } - */ -} diff --git a/vendor/antgoods/goods/src/migrations/m191202_032835_update_column_sort_order_in_antgoods_category.php b/vendor/antgoods/goods/src/migrations/m191202_032835_update_column_sort_order_in_antgoods_category.php deleted file mode 100644 index 21aff0c..0000000 --- a/vendor/antgoods/goods/src/migrations/m191202_032835_update_column_sort_order_in_antgoods_category.php +++ /dev/null @@ -1,43 +0,0 @@ -dropColumn('antgoods_category', 'sort_order'); - $this->addColumn('antgoods_category', 'sort_order', $this->smallInteger(3)->defaultValue(0)->comment('排序')); - } - - /** - * {@inheritdoc} - */ - public function safeDown() - { - $this->dropColumn('antgoods_category', 'sort_order'); - $this->addColumn('antgoods_category', 'sort_order', $this->smallInteger(3)->unsigned()->defaultValue(0)->comment('排序')); - return true; - } - - /* - // Use up()/down() to run migration code without a transaction. - public function up() - { - - } - - public function down() - { - echo "m191202_032835_update_column_sort_order_in_antgoods_category cannot be reverted.\n"; - - return false; - } - */ -} diff --git a/vendor/antgoods/goods/src/models/ars/Attribute.php b/vendor/antgoods/goods/src/models/ars/Attribute.php index 75ce239..0d7bee3 100644 --- a/vendor/antgoods/goods/src/models/ars/Attribute.php +++ b/vendor/antgoods/goods/src/models/ars/Attribute.php @@ -44,25 +44,9 @@ class Attribute extends \yii\db\ActiveRecord [['value'], 'string'], [['type', 'sort_order', 'is_delete', 'cat_id'], 'integer'], [['name'], 'string', 'max' => 50], - [['sort_order'], 'checkNegative'], ]; } - /** - * @param $attribute - * @param $params - * 验证是否为负数 - */ - public function checkNegative($attribute, $params) - { - if ($this->$attribute < 0) { - $this->addError($attribute, "不得为负数"); - } - if ($this->$attribute > 65535) { - $this->addError($attribute, "不得大于65535"); - } - } - /** * {@inheritdoc} */ diff --git a/vendor/antgoods/goods/src/models/ars/Category.php b/vendor/antgoods/goods/src/models/ars/Category.php index e9ff057..a919057 100644 --- a/vendor/antgoods/goods/src/models/ars/Category.php +++ b/vendor/antgoods/goods/src/models/ars/Category.php @@ -54,25 +54,9 @@ class Category extends \yii\db\ActiveRecord [['pid', 'goods_count', 'sort_order', 'is_show', 'is_delete', 'icon'], 'integer'], [['name'], 'string', 'max' => 60], [['iconImageId'], 'string'], - [['sort_order'], 'checkNegative'], ]; } - /** - * @param $attribute - * @param $params - * 验证是否为负数 - */ - public function checkNegative($attribute, $params) - { - if ($this->$attribute < 0) { - $this->addError($attribute, "不得为负数"); - } - if ($this->$attribute > 65535) { - $this->addError($attribute, "不得大于65535"); - } - } - /** * {@inheritdoc} */ diff --git a/vendor/antgoods/goods/src/views/goods/goods.php b/vendor/antgoods/goods/src/views/goods/goods.php index 4a253b5..8051b7f 100644 --- a/vendor/antgoods/goods/src/views/goods/goods.php +++ b/vendor/antgoods/goods/src/views/goods/goods.php @@ -5,6 +5,7 @@ use antgoods\goods\models\ars\Brand; use antgoods\goods\models\ars\ShopCategory; use antgoods\goods\models\ars\Supplier; use linyao\widgets\Select2; +use yii\bootstrap4\Html; /* @var $this yii\web\View */ /* @var $model antgoods\goods\models\ars\Goods */ @@ -55,3 +56,8 @@ use linyao\widgets\Select2; field($model, 'bouns_points')->textInput() ?> field($model, 'experience_points')->textInput() ?> + +
+ 'btn btn-success']) ?> + 'btn btn-info']) ?> +
\ No newline at end of file