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 = [