车型搜索

This commit is contained in:
2025-10-11 10:18:30 +08:00
parent e3572cde9e
commit 788d962044
2 changed files with 13 additions and 2 deletions
+2 -2
View File
@@ -306,8 +306,8 @@ class BrandSeriesService
$modelData = [ $modelData = [
'brand_code' => $brand->brand_code, 'brand_code' => $brand->brand_code,
'brand_name' => $brand->brand_name, 'brand_name' => $brand->brand_name,
'series_code' => $series->series_code ?? '', 'series_code' => $series->series_code,
'series_name' => $series->series_name ?? '', 'series_name' => $series->series_name,
'model_name' => $item['title'], 'model_name' => $item['title'],
'model_year' => $item['year'], 'model_year' => $item['year'],
'msrp' => $item['msrp'], 'msrp' => $item['msrp'],
@@ -5,6 +5,8 @@ namespace app\common\service;
use app\common\logic\Fingerprint; use app\common\logic\Fingerprint;
use app\common\logic\ModelNaming; use app\common\logic\ModelNaming;
use app\common\logic\SkuCodeBuilder; use app\common\logic\SkuCodeBuilder;
use app\common\model\Brand;
use app\common\model\BrandSeries;
use app\common\validate\VehVehicleSkuValidate; use app\common\validate\VehVehicleSkuValidate;
use app\common\traits\crud\CrudServiceTrait; use app\common\traits\crud\CrudServiceTrait;
use app\common\model\VehVehicleSku; use app\common\model\VehVehicleSku;
@@ -111,6 +113,15 @@ class VehVehicleSkuService
$config['orWhere'][] = [$col, 'like', $k]; $config['orWhere'][] = [$col, 'like', $k];
} }
} }
if(isset($p['brand_id']) && $p['brand_id']){
$brand_code = Brand::where('id', $p['brand_id'])->value('brand_code');
$config['where']['brand_code'] = $brand_code;
}
if(isset($p['series_id']) && $p['series_id']){
$series_code = BrandSeries::where('id', $p['series_id'])->value('series_code');
$config['where']['series_code'] = $series_code;
}
break; break;
case 'show': case 'show':
$config['where']['id'] = $p['id']; $config['where']['id'] = $p['id'];