diff --git a/app/admin/service/BrandSeriesService.php b/app/admin/service/BrandSeriesService.php index cc946c8..7bf9b75 100644 --- a/app/admin/service/BrandSeriesService.php +++ b/app/admin/service/BrandSeriesService.php @@ -306,8 +306,8 @@ class BrandSeriesService $modelData = [ 'brand_code' => $brand->brand_code, 'brand_name' => $brand->brand_name, - 'series_code' => $series->series_code ?? '', - 'series_name' => $series->series_name ?? '', + 'series_code' => $series->series_code, + 'series_name' => $series->series_name, 'model_name' => $item['title'], 'model_year' => $item['year'], 'msrp' => $item['msrp'], diff --git a/app/common/service/VehVehicleSkuService.php b/app/common/service/VehVehicleSkuService.php index e494122..d8c6e4a 100644 --- a/app/common/service/VehVehicleSkuService.php +++ b/app/common/service/VehVehicleSkuService.php @@ -5,6 +5,8 @@ namespace app\common\service; use app\common\logic\Fingerprint; use app\common\logic\ModelNaming; use app\common\logic\SkuCodeBuilder; +use app\common\model\Brand; +use app\common\model\BrandSeries; use app\common\validate\VehVehicleSkuValidate; use app\common\traits\crud\CrudServiceTrait; use app\common\model\VehVehicleSku; @@ -111,6 +113,15 @@ class VehVehicleSkuService $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; case 'show': $config['where']['id'] = $p['id'];