Browse Source

修改前端分类列表字段

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
0332718125
  1. 1
      vendor/antgoods/goods/src/controllers/ShopCategoryController.php
  2. 1
      vendor/antgoods/goods/src/models/ars/Category.php
  3. 2
      vendor/antgoods/goods/src/models/ars/ShopCategory.php
  4. 2
      vendor/antgoods/goods/src/models/searchs/GoodsSearch.php
  5. 14
      vendor/antgoods/goods/src/views/shop-category/view.php

1
vendor/antgoods/goods/src/controllers/ShopCategoryController.php

@ -79,6 +79,7 @@ class ShopCategoryController extends Controller
public function actionCreate() public function actionCreate()
{ {
$model = new ShopCategory(); $model = new ShopCategory();
$model->is_show = ShopCategory::IS_SHOW_HIDE;
if ($model->load(Yii::$app->request->post())) { if ($model->load(Yii::$app->request->post())) {
if ($model->filter_attr != null && is_array($model->filter_attr)) { if ($model->filter_attr != null && is_array($model->filter_attr)) {

1
vendor/antgoods/goods/src/models/ars/Category.php

@ -68,7 +68,6 @@ class Category extends \yii\db\ActiveRecord
'pid' => '父级id', 'pid' => '父级id',
'goods_count' => '商品数量', 'goods_count' => '商品数量',
'sort_order' => '排序', 'sort_order' => '排序',
'icon_type' => '图标类型',
'icon' => '图标', 'icon' => '图标',
'is_show' => '是否显示', 'is_show' => '是否显示',
'is_delete' => '是否删除,1为已删除', 'is_delete' => '是否删除,1为已删除',

2
vendor/antgoods/goods/src/models/ars/ShopCategory.php

@ -15,7 +15,6 @@ use yii\behaviors\TimestampBehavior;
* @property string $keywords 关键字 * @property string $keywords 关键字
* @property string $desc 描述 * @property string $desc 描述
* @property int $sort_order 排序 * @property int $sort_order 排序
* @property int $icon_type 图标类型
* @property string $icon 图标 * @property string $icon 图标
* @property string $filter_attr 筛选属性 * @property string $filter_attr 筛选属性
* @property int $is_show 是否显示,1为不显示 * @property int $is_show 是否显示,1为不显示
@ -75,7 +74,6 @@ class ShopCategory extends \yii\db\ActiveRecord
'keywords' => '关键字', 'keywords' => '关键字',
'desc' => '描述', 'desc' => '描述',
'sort_order' => '排序', 'sort_order' => '排序',
'icon_type' => '图标类型',
'icon' => '图标', 'icon' => '图标',
'filter_attr' => '筛选属性', 'filter_attr' => '筛选属性',
'is_show' => '是否显示', 'is_show' => '是否显示',

2
vendor/antgoods/goods/src/models/searchs/GoodsSearch.php

@ -100,7 +100,7 @@ class GoodsSearch extends Goods
'width' => '5%', 'width' => '5%',
'value' => 'value' =>
function ($model) { function ($model) {
return $model->is_sale ? Goods::$isSale[$model->is_sale] : '未设置';
return $model->is_sale==Goods::IS_SALE_YES ? '在售' : '不在售';
}, },
], ],

14
vendor/antgoods/goods/src/views/shop-category/view.php

@ -2,6 +2,7 @@
use yii\helpers\Html; use yii\helpers\Html;
use yii\widgets\DetailView; use yii\widgets\DetailView;
use antgoods\goods\models\ars\ShopCategory;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model antgoods\goods\models\ars\ShopCategory */ /* @var $model antgoods\goods\models\ars\ShopCategory */
@ -22,16 +23,19 @@ $this->params['breadcrumbs'][] = $this->title;
'attributes' => [ 'attributes' => [
'id', 'id',
'name', 'name',
'pid',
'goods_count',
'keywords', 'keywords',
'desc', 'desc',
'sort_order', 'sort_order',
'icon_type',
'icon', 'icon',
'filter_attr:ntext', 'filter_attr:ntext',
'is_show',
'is_delete',
['attribute' => 'is_show',
'width' => '5%',
'value' =>
function ($model) {
return $model->is_show == ShopCategory::IS_SHOW_HIDE ? '隐藏' : '显示';
},
],
'created_at:datetime', 'created_at:datetime',
'updated_at:datetime', 'updated_at:datetime',
], ],

Loading…
Cancel
Save