提交 60cfc006 编写于 作者: D devil_gong

商品保存优化

上级 fbbb1c99
...@@ -958,13 +958,13 @@ class GoodsService ...@@ -958,13 +958,13 @@ class GoodsService
// 基础数据 // 基础数据
$data = [ $data = [
'title' => $params['title'], 'title' => $params['title'],
'title_color' => $params['title_color'], 'title_color' => empty($params['title_color']) ? '' : $params['title_color'],
'model' => $params['model'], 'model' => $params['model'],
'place_origin' => intval($params['place_origin']), 'place_origin' => isset($params['place_origin']) ? intval($params['place_origin']) : 0,
'inventory_unit' => $params['inventory_unit'], 'inventory_unit' => $params['inventory_unit'],
'give_integral' => intval($params['give_integral']), 'give_integral' => intval($params['give_integral']),
'buy_min_number' => intval($params['buy_min_number']), 'buy_min_number' => max(1, isset($params['buy_min_number']) ? intval($params['buy_min_number']) : 1),
'buy_max_number' => intval($params['buy_max_number']), 'buy_max_number' => isset($params['buy_max_number']) ? intval($params['buy_max_number']) : 0,
'is_deduction_inventory' => isset($params['is_deduction_inventory']) ? intval($params['is_deduction_inventory']) : 0, 'is_deduction_inventory' => isset($params['is_deduction_inventory']) ? intval($params['is_deduction_inventory']) : 0,
'is_shelves' => isset($params['is_shelves']) ? intval($params['is_shelves']) : 0, 'is_shelves' => isset($params['is_shelves']) ? intval($params['is_shelves']) : 0,
'content_web' => ResourcesService::ContentStaticReplace($params['content_web'], 'add'), 'content_web' => ResourcesService::ContentStaticReplace($params['content_web'], 'add'),
...@@ -972,7 +972,7 @@ class GoodsService ...@@ -972,7 +972,7 @@ class GoodsService
'photo_count' => count($photo['data']), 'photo_count' => count($photo['data']),
'is_home_recommended' => isset($params['is_home_recommended']) ? intval($params['is_home_recommended']) : 0, 'is_home_recommended' => isset($params['is_home_recommended']) ? intval($params['is_home_recommended']) : 0,
'home_recommended_images' => $attachment['data']['home_recommended_images'], 'home_recommended_images' => $attachment['data']['home_recommended_images'],
'brand_id' => intval($params['brand_id']), 'brand_id' => isset($params['brand_id']) ? intval($params['brand_id']) : 0,
'video' => $attachment['data']['video'], 'video' => $attachment['data']['video'],
]; ];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册