鲜花2.0-文案调整

This commit is contained in:
杨建炊 2024-08-23 15:33:10 +08:00
parent 16b93f1619
commit 2c974cfbc0
2 changed files with 5 additions and 3 deletions

View File

@ -200,7 +200,7 @@ class GoodsCombinationController extends Controller
->with('goods:id,title')
->get(['id', 'title', 'goods_id']);
foreach ($skus as &$sku) {
$sku['title'] = $sku['goods']['title'] . $sku['title'];
$sku['title'] = ($sku['goods']['title'] ?? "") . $sku['title'];
}
return GoodsSkuResource::collection($skus);

View File

@ -200,7 +200,9 @@ class GoodsSkusController extends Controller
$this->setBeforeUpdateForLog($sku->toArray());
$skuInfo = $request->sku;
$goodService = new GoodService();
$skuInfo['name'] = $goodService->getTypeFormatName($request->goods['type_id']) . $request->sku['title'];
$goods = $goodService->saveDefaultGoodsByGoodType($request->goods['type_id']);
$skuInfo['goods_id'] = $goods->id;
$skuInfo['name'] =$goods->title. $request->sku['title'];
$sku->update($skuInfo);
$this->setAfterUpdateForLog($sku->toArray());
$this->addLog($id, 'update');