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'][] = '编辑 '; ?>