|
|
@ -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', |
|
|
|