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] =?UTF-8?q?fixed=20=E5=95=86=E6=88=B7=E5=85=A5=E9=A9=BB?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A8=E7=9A=84village=5Fid=E4=B8=BAint=E5=9E=8B=EF=BC=8C?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E4=BC=A0=E7=9A=84=E6=98=AFvillage=5Fcode?= =?UTF-8?q?=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 = [