From ea2fe056f6f6e0f4dc8268cb2ceafbe68922c09e Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Sat, 2 Dec 2023 15:54:49 +0800 Subject: [PATCH 1/7] =?UTF-8?q?debug=20=E7=A7=8D=E5=85=BB=E6=AE=96?= =?UTF-8?q?=E5=95=86=E6=88=B7=E9=94=80=E5=94=AE=E7=BB=9F=E8=AE=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Statistics.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controller/api/Statistics.php b/app/controller/api/Statistics.php index b4dcca17..e61d5122 100644 --- a/app/controller/api/Statistics.php +++ b/app/controller/api/Statistics.php @@ -300,6 +300,7 @@ class Statistics extends BaseController $area[] = ['category_id', '=', $merchant_category_id]; $merchant = Db::name('merchant')->where($area)->column('mer_id'); + dd(Db::name('merchant')->getLastSql()); if (!$merchant) { return app('json')->fail('查询商户为空'); } From 02dd63c7e30cf6905227de01c1ad9567926b5b74 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Sat, 2 Dec 2023 16:02:22 +0800 Subject: [PATCH 2/7] =?UTF-8?q?debug=20=E7=A7=8D=E5=85=BB=E6=AE=96?= =?UTF-8?q?=E5=95=86=E6=88=B7=E9=94=80=E5=94=AE=E7=BB=9F=E8=AE=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Statistics.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controller/api/Statistics.php b/app/controller/api/Statistics.php index e61d5122..b4dcca17 100644 --- a/app/controller/api/Statistics.php +++ b/app/controller/api/Statistics.php @@ -300,7 +300,6 @@ class Statistics extends BaseController $area[] = ['category_id', '=', $merchant_category_id]; $merchant = Db::name('merchant')->where($area)->column('mer_id'); - dd(Db::name('merchant')->getLastSql()); if (!$merchant) { return app('json')->fail('查询商户为空'); } From 9d50f9e7eb6d25896e31aa4ba54f519b606b9627 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Sat, 2 Dec 2023 16:21:24 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fixed=20=E5=95=86=E6=88=B7=E5=85=A5?= =?UTF-8?q?=E9=A9=BB=E6=8E=A5=E6=94=B6=E5=BA=97=E9=93=BA=E6=9D=91/?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=9C=B0=E5=8C=BA=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/merchant/MerchantIntention.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index b812fc36..defa5f61 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -91,6 +91,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']??'' @@ -196,6 +197,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 +300,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']??'' From 60e10e43adfc7080a384b59432516cabf179ea0a Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Sat, 2 Dec 2023 16:56:18 +0800 Subject: [PATCH 4/7] =?UTF-8?q?debug=20=E5=95=86=E6=88=B7=E5=85=A5?= =?UTF-8?q?=E9=A9=BB=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/merchant/MerchantIntention.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index defa5f61..a9e8ba3a 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -182,6 +182,8 @@ class MerchantIntention extends BaseController $intenInfo['status'] = 0; $intenInfo['create_time'] = date('Y-m-d H:i:s'); unset($intenInfo['mer_intention_id']); + halt($intenInfo); + $intenInfo['village_id'] = Db::name('geo_village')->where('village_code', $data['village_id'])->value('village_id'); $intentionId = Db::name('merchant_intention')->insertGetId($intenInfo); $areaInfo = Db::name('geo_area')->where('area_code', $intenInfo['area_id'] ?? '')->find(); $sendData = [ From 1ecdff83fc9c0c000cdfe7def3da63475bfb95e1 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Sat, 2 Dec 2023 17:02:32 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fixed=20=E5=95=86=E6=88=B7=E5=85=A5?= =?UTF-8?q?=E9=A9=BB=E7=94=B3=E8=AF=B7=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=A1=A8=E7=9A=84village=5Fid=E4=B8=BAint=E5=9E=8B?= =?UTF-8?q?=EF=BC=8C=E5=89=8D=E7=AB=AF=E4=BC=A0=E7=9A=84=E6=98=AFvillage?= =?UTF-8?q?=5Fcode=EF=BC=8C=E5=8F=AF=E8=83=BD=E8=B6=85=E8=BF=8711=E4=BD=8D?= =?UTF-8?q?=EF=BC=8Cint=E6=9C=80=E5=A4=A7=E5=8F=AF=E5=AD=98=E5=82=A811?= =?UTF-8?q?=E4=BD=8D=EF=BC=8C=E5=AF=BC=E8=87=B4sql=E6=8A=A5=E9=94=99?= =?UTF-8?q?=EF=BC=8C=E8=BD=AC=E6=8D=A2=E4=B8=BAgeo=5Fvillage=E7=9A=84?= =?UTF-8?q?=E4=B8=BB=E9=94=AEid=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/merchant/MerchantIntention.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index a9e8ba3a..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', @@ -181,9 +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']); - halt($intenInfo); - $intenInfo['village_id'] = Db::name('geo_village')->where('village_code', $data['village_id'])->value('village_id'); + $intentionId = Db::name('merchant_intention')->insertGetId($intenInfo); $areaInfo = Db::name('geo_area')->where('area_code', $intenInfo['area_id'] ?? '')->find(); $sendData = [ From 0350c4d655a37382c13e8308be5817f84c0e0bff Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 2 Dec 2023 18:32:38 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A7=84=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/order/StoreOrderRepository.php | 6 ++++++ 1 file changed, 6 insertions(+) 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[] = [ From 08b6c51ab1095463ac90a5a5658a8d7b37fd1a3b Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 2 Dec 2023 19:49:56 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/product/ProductRepository.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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; }