From ba031cbe252a7739a726e914f5b4e41b9341c9e8 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Wed, 11 Dec 2019 19:12:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=88=97=E8=A1=A8=E5=AD=97=E6=AE=B5=E5=92=8C?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/models/searchs/GoodsSearch.php | 26 ++++++------------- backend/modules/goods/views/goods/_search.php | 13 ---------- 2 files changed, 8 insertions(+), 31 deletions(-) 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}",