diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 0d8f07c1..2bc23d61 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -2510,6 +2510,12 @@ class StoreOrderRepository extends BaseRepository $attr = []; $arr = []; + if(!$attr_one){ + $attr_one[] = '规格'; + } + if(!$attr_two){ + $attr_two[] = '默认'; + } foreach ($attr_one as $key => $value) { $attr[$value] = $attr_two[$key]; $arr[] = [ diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 245e4a64..c809b8d5 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -525,11 +525,13 @@ class ProductRepository extends BaseRepository { $result = []; foreach ($data as $value) { - $result[] = [ - 'product_id' => $productId, - 'mer_cate_id' => $value, - 'mer_id' => $merId, - ]; + if($value['category']){ + $result[] = [ + 'product_id' => $productId, + 'mer_cate_id' => $value, + 'mer_id' => $merId, + ]; + } } return $result; } diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index b812fc36..93b93e51 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -68,6 +68,8 @@ class MerchantIntention extends BaseController $adminRepository = app()->make(MerchantAdminRepository::class); if ($adminRepository->fieldExists('account', $data['phone'])) throw new ValidateException('手机号已是管理员,不可申请'); + // 数据表的village_id为int型,前端传的是village_code,可能超过11位,int最大可存储11位,导致sql报错。 转换为主键id存储 + $data['village_id'] = Db::name('geo_village')->where('village_code', $data['village_id'])->value('village_id'); $intention = $this->repository->create($data); SwooleTaskService::admin('notice', [ 'type' => 'new_intention', @@ -91,6 +93,7 @@ class MerchantIntention extends BaseController 'city' => $areaInfo['city_code'] ?? '', 'area' => $data['area_id'] ?? '', 'street' => $data['street_id'] ?? '', + 'village' => $data['village_id'] ?? '', 'address' => $data['address'] ?? '', 'mer_intention_id' => $intention->mer_intention_id, 'type_id'=>$data['mer_type_id']??'' @@ -180,7 +183,9 @@ class MerchantIntention extends BaseController $intenInfo['type'] = 2; $intenInfo['status'] = 0; $intenInfo['create_time'] = date('Y-m-d H:i:s'); + unset($intenInfo['mer_intention_id']); + $intentionId = Db::name('merchant_intention')->insertGetId($intenInfo); $areaInfo = Db::name('geo_area')->where('area_code', $intenInfo['area_id'] ?? '')->find(); $sendData = [ @@ -196,6 +201,7 @@ class MerchantIntention extends BaseController 'city' => $areaInfo['city_code'] ?? '', 'area' => $merInfo['area_id'] ?? '', 'street' => $merInfo['street_id'] ?? '', + 'village' => $data['village_id'] ?? '', 'address' => $intenInfo['address'] ?? '', 'bank_username' => $data['bank_username'] ?? '', 'bank_opening' => $data['bank_opening'] ?? '', @@ -298,6 +304,7 @@ class MerchantIntention extends BaseController 'city' => $areaInfo['city_code'] ?? '', 'area' => $data['area_id'] ?? '', 'street' => $data['street_id'] ?? '', + 'village' => $data['village_id'] ?? '', 'address' => $data['address'] ?? '', 'mer_intention_id' => $id, 'type_id'=>$data['mer_type_id']??''