From 60cfc00614aa0afd6d3a6846e326b7c49f152487 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Fri, 15 Feb 2019 11:13:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E4=BF=9D=E5=AD=98=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/GoodsService.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/service/GoodsService.php b/application/service/GoodsService.php index ef7c7260a..f49cb7f8c 100755 --- a/application/service/GoodsService.php +++ b/application/service/GoodsService.php @@ -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'], ]; -- GitLab