From 573af0427528a44c9439a085b9e3c485009b0b09 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Wed, 20 Nov 2019 11:11:42 +0800 Subject: [PATCH] =?UTF-8?q?antgoods=E6=A8=A1=E5=9D=97=E5=93=81=E7=89=8C?= =?UTF-8?q?=E5=92=8C=E5=88=86=E7=B1=BB=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=94=AE=E5=80=BC=E5=AF=B9=E6=96=B9=E6=B3=95=EF=BC=8C=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=AE=8C=E6=88=90=E9=83=A8=E5=88=86=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/antgoods/goods/src/models/ars/Brand.php | 5 +++++ vendor/antgoods/goods/src/models/ars/Category.php | 5 +++++ vendor/antgoods/goods/src/views/goods/_form.php | 10 ++++------ vendor/antgoods/goods/src/views/goods/update.php | 6 +++--- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/vendor/antgoods/goods/src/models/ars/Brand.php b/vendor/antgoods/goods/src/models/ars/Brand.php index bf681bd..f3e49b5 100644 --- a/vendor/antgoods/goods/src/models/ars/Brand.php +++ b/vendor/antgoods/goods/src/models/ars/Brand.php @@ -74,4 +74,9 @@ class Brand extends \yii\db\ActiveRecord ], ]; } + + public static function modelColumn() + { + return $column = Brand::find()->select(['name'])->where(['is_delete' => self::IS_DELETE_NO])->indexBy('id')->column(); + } } diff --git a/vendor/antgoods/goods/src/models/ars/Category.php b/vendor/antgoods/goods/src/models/ars/Category.php index 212def5..7d4fa46 100644 --- a/vendor/antgoods/goods/src/models/ars/Category.php +++ b/vendor/antgoods/goods/src/models/ars/Category.php @@ -96,4 +96,9 @@ class Category extends \yii\db\ActiveRecord ], ]; } + + public static function modelColumn() + { + return $column = Category::find()->select(['name'])->where(['is_delete' => self::IS_DELETE_NO])->indexBy('id')->column(); + } } diff --git a/vendor/antgoods/goods/src/views/goods/_form.php b/vendor/antgoods/goods/src/views/goods/_form.php index 5956348..a944d3e 100644 --- a/vendor/antgoods/goods/src/views/goods/_form.php +++ b/vendor/antgoods/goods/src/views/goods/_form.php @@ -2,6 +2,8 @@ use yii\helpers\Html; use yii\widgets\ActiveForm; +use antgoods\goods\models\ars\Category; +use antgoods\goods\models\ars\Brand; /* @var $this yii\web\View */ /* @var $model antgoods\goods\models\ars\Goods */ @@ -12,11 +14,9 @@ use yii\widgets\ActiveForm; - field($model, 'pid')->textInput() ?> + field($model, 'cat_id')->dropDownList(Category::modelColumn(), ['prompt' => '请选择']) ?> - field($model, 'cat_id')->textInput() ?> - - field($model, 'brand_id')->textInput() ?> + field($model, 'brand_id')->dropDownList(Brand::modelColumn(), ['prompt' => '请选择']) ?> field($model, 'shop_cat_id')->textInput() ?> @@ -68,8 +68,6 @@ use yii\widgets\ActiveForm; field($model, 'experience_points')->textInput() ?> - field($model, 'is_delete')->textInput() ?> - field($model, 'express_template')->textInput() ?>
diff --git a/vendor/antgoods/goods/src/views/goods/update.php b/vendor/antgoods/goods/src/views/goods/update.php index 9689d6d..c4a3cf1 100644 --- a/vendor/antgoods/goods/src/views/goods/update.php +++ b/vendor/antgoods/goods/src/views/goods/update.php @@ -5,10 +5,10 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model antgoods\goods\models\ars\Goods */ -$this->title = '编辑 Goods: ' . $model->name; -$this->params['breadcrumbs'][] = ['label' => 'Goods', 'url' => ['index']]; +$this->title = '编辑商品: ' . $model->name; +$this->params['breadcrumbs'][] = ['label' => '商品管理', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; -$this->params['breadcrumbs'][] = 'Update '; +$this->params['breadcrumbs'][] = '编辑 '; ?>