From 788d962044fb5cc990f1d92a44a54f9088f092e6 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Sat, 11 Oct 2025 10:18:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E5=9E=8B=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/BrandSeriesService.php | 4 ++-- app/common/service/VehVehicleSkuService.php | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) 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'];