diff --git a/backend/modules/goods/models/searchs/GoodsSearch.php b/backend/modules/goods/models/searchs/GoodsSearch.php index f70194c..e0f62c6 100755 --- a/backend/modules/goods/models/searchs/GoodsSearch.php +++ b/backend/modules/goods/models/searchs/GoodsSearch.php @@ -7,8 +7,7 @@ use yii\data\ActiveDataProvider; use yii\helpers\ArrayHelper; use backend\modules\goods\models\ars\Goods; use yii\bootstrap4\Html; -use backend\modules\goods\models\ars\Category; -use backend\modules\goods\models\ars\ShopCategory; +use backend\modules\shop\logic\ShopManager; /** * GoodsSearch represents the model behind the search form of `backend\modules\goods\models\ars\Goods`. @@ -55,7 +54,6 @@ class GoodsSearch extends Goods 'width' => '2%', 'align' => 'center' ], - 'id', ['attribute' => 'image', 'contentOptions' => [ 'align' => 'center', @@ -71,18 +69,16 @@ class GoodsSearch extends Goods ], 'name', [ - 'attribute' => 'cat_id', - 'width' => '10%', + 'attribute' => 'market_price', 'value' => function ($model) { - return $model->category ? $model->category->name : ''; - }, + return sprintf("%1\$.2f",$model->market_price / ShopManager::proportionalConversion(ShopManager::UNIT_TYPE_MONEY)); + } ], [ - 'attribute' => 'shop_cat_id', - 'width' => '10%', + 'attribute' => 'price', 'value' => function ($model) { - return $model->shopCategory ? $model->shopCategory->name : ''; - }, + return sprintf("%1\$.2f",$model->price / ShopManager::proportionalConversion(ShopManager::UNIT_TYPE_MONEY)); + } ], [ 'attribute' => 'stock', @@ -95,7 +91,6 @@ class GoodsSearch extends Goods } }, ], - 'price', ['attribute' => 'is_sale', 'width' => '5%', 'value' => @@ -104,16 +99,11 @@ class GoodsSearch extends Goods }, ], - 'updated_at:datetime', + 'sort_order', [ 'class' => 'iron\grid\ActionColumn', 'align' => 'center', 'config' => [ - [ - 'name' => 'view', - 'icon' => 'list', - 'title' => '详情', - ], [ 'name' => 'update', 'icon' => 'pencil', diff --git a/backend/modules/goods/views/goods/_search.php b/backend/modules/goods/views/goods/_search.php index 8e00aec..7e8e234 100755 --- a/backend/modules/goods/views/goods/_search.php +++ b/backend/modules/goods/views/goods/_search.php @@ -19,19 +19,6 @@ use backend\modules\goods\models\ars\ShopCategory; ]); ?>
-
- field($model, 'id', [ - "template" => "{input}{error}", - "inputOptions" => [ - "placeholder" => "检索ID", - "class" => "form-control", - ], - "errorOptions" => [ - "class" => "error-tips" - ] - ]) - ?> -
field($model, 'name', [ "template" => "{input}{error}",