This commit is contained in:
Edward Yang 2022-08-23 16:33:08 +08:00
parent 05410da29e
commit ba32addfdb
4 changed files with 8 additions and 6 deletions

View File

@ -102,12 +102,6 @@ class ProductRepo
});
}
if (isset($data['model'])) {
$builder->whereHas('skus', function ($query) use ($data) {
$query->where('sku', 'like', "%{$data['sku']}%");
});
}
if (isset($data['name'])) {
$builder->whereHas('description', function ($query) use ($data) {
$query->where('name', 'like', "%{$data['name']}%");

View File

@ -26,6 +26,11 @@
<input type="text" v-model="filter.sku" class="form-control" placeholder="sku">
</div>
<div class="col-xxl-20 col-xl-3 col-lg-4 col-md-4 d-flex align-items-center mb-3">
<label class="filter-title">{{ __('product.model') }}</label>
<input type="text" v-model="filter.model" class="form-control" placeholder="model">
</div>
<div class="col-xxl-20 col-xl-3 col-lg-4 col-md-4 d-flex align-items-center mb-3">
<label class="filter-title">{{ __('product.category') }}</label>
<select v-model="filter.category_id" class="form-control">
@ -147,6 +152,7 @@
name: bk.getQueryString('name'),
category_id: bk.getQueryString('category_id'),
sku: bk.getQueryString('sku'),
model: bk.getQueryString('model'),
active: bk.getQueryString('active'),
},
selected: [],

View File

@ -15,4 +15,5 @@ return [
'price' => 'Price',
'brand' => 'Brand',
'category' => 'Category',
'model' => 'Model',
];

View File

@ -15,4 +15,5 @@ return [
'price' => '价格',
'brand' => '品牌',
'category' => '分类',
'model' => '型号'
];