商品保存优化

feat/task1-c-wallet
devil_gong 2019-02-15 11:13:52 +08:00
parent fbbb1c9958
commit 60cfc00614
1 changed files with 5 additions and 5 deletions

View File

@ -958,13 +958,13 @@ class GoodsService
// 基础数据
$data = [
'title' => $params['title'],
'title_color' => $params['title_color'],
'title_color' => empty($params['title_color']) ? '' : $params['title_color'],
'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'],
'give_integral' => intval($params['give_integral']),
'buy_min_number' => intval($params['buy_min_number']),
'buy_max_number' => intval($params['buy_max_number']),
'buy_min_number' => max(1, isset($params['buy_min_number']) ? intval($params['buy_min_number']) : 1),
'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_shelves' => isset($params['is_shelves']) ? intval($params['is_shelves']) : 0,
'content_web' => ResourcesService::ContentStaticReplace($params['content_web'], 'add'),
@ -972,7 +972,7 @@ class GoodsService
'photo_count' => count($photo['data']),
'is_home_recommended' => isset($params['is_home_recommended']) ? intval($params['is_home_recommended']) : 0,
'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'],
];