fixed 商户入驻申请接口,数据表的village_id为int型,前端传的是village_code,可能超过11位,int最大可存储11位,导致sql报错,转换为geo_village的主键id存储
This commit is contained in:
parent
60e10e43ad
commit
1ecdff83fc
@ -68,6 +68,8 @@ class MerchantIntention extends BaseController
|
|||||||
$adminRepository = app()->make(MerchantAdminRepository::class);
|
$adminRepository = app()->make(MerchantAdminRepository::class);
|
||||||
if ($adminRepository->fieldExists('account', $data['phone']))
|
if ($adminRepository->fieldExists('account', $data['phone']))
|
||||||
throw new ValidateException('手机号已是管理员,不可申请');
|
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);
|
$intention = $this->repository->create($data);
|
||||||
SwooleTaskService::admin('notice', [
|
SwooleTaskService::admin('notice', [
|
||||||
'type' => 'new_intention',
|
'type' => 'new_intention',
|
||||||
@ -181,9 +183,9 @@ class MerchantIntention extends BaseController
|
|||||||
$intenInfo['type'] = 2;
|
$intenInfo['type'] = 2;
|
||||||
$intenInfo['status'] = 0;
|
$intenInfo['status'] = 0;
|
||||||
$intenInfo['create_time'] = date('Y-m-d H:i:s');
|
$intenInfo['create_time'] = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
unset($intenInfo['mer_intention_id']);
|
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);
|
$intentionId = Db::name('merchant_intention')->insertGetId($intenInfo);
|
||||||
$areaInfo = Db::name('geo_area')->where('area_code', $intenInfo['area_id'] ?? '')->find();
|
$areaInfo = Db::name('geo_area')->where('area_code', $intenInfo['area_id'] ?? '')->find();
|
||||||
$sendData = [
|
$sendData = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user