add:1.企业实名认证改为根据异步回调认证,如果失败记录认证失败原因。
This commit is contained in:
parent
edc20b92bd
commit
d0dcded2f9
app
@ -201,15 +201,15 @@ class CompanyController extends BaseAdminController
|
|||||||
if ($res->success == true) {
|
if ($res->success == true) {
|
||||||
$email = substr(uniqid(),2,5).$res->data;
|
$email = substr(uniqid(),2,5).$res->data;
|
||||||
// 企业人脸上传
|
// 企业人脸上传
|
||||||
$company['master_email'] = $email; // 法人邮箱
|
// $company['master_email'] = $email; // 法人邮箱
|
||||||
$faceCreateRe = CompanyLogic::originationFaceCreate($company);
|
// $faceCreateRe = CompanyLogic::originationFaceCreate($company);
|
||||||
if ($faceCreateRe !== true) {
|
// if ($faceCreateRe !== true) {
|
||||||
return $this->fail($faceCreateRe);
|
// return $this->fail($faceCreateRe);
|
||||||
}
|
// }
|
||||||
// 修改法人邮箱和公司认证状态
|
// 修改法人邮箱
|
||||||
Db::name('company')->where('id', $params['id'])->update(['master_email' => $email,'is_authentication'=>1]);
|
Db::name('company')->where('id', $params['id'])->update(['master_email' => $email]);
|
||||||
return $this->success('认证成功',[],1, 1);
|
// return $this->success('认证成功',[],1, 1);
|
||||||
// return $this->success('系统认证中,请稍后刷新页面查看', ['email' => $res->data], 1, 1);
|
return $this->success('系统认证中,请稍后刷新页面查看', ['email' => $res->data], 1, 1);
|
||||||
} else {
|
} else {
|
||||||
return $this->fail($res->msg);
|
return $this->fail($res->msg);
|
||||||
}
|
}
|
||||||
@ -248,25 +248,12 @@ class CompanyController extends BaseAdminController
|
|||||||
{
|
{
|
||||||
$params = (new CompanyValidate())->goCheck('detail');
|
$params = (new CompanyValidate())->goCheck('detail');
|
||||||
$company = Db::name('company')->where('id', $params['id'])->find();
|
$company = Db::name('company')->where('id', $params['id'])->find();
|
||||||
// 公司数据合法性校验
|
$re = CompanyLogic::originationFaceCreate($company);
|
||||||
$this->companyCheck($company);
|
if ($re === true) {
|
||||||
|
return $this->success('成功',[],1, 1);
|
||||||
$data = [
|
|
||||||
'company_name' => $company['company_name'],
|
|
||||||
'organization_code' => $company['organization_code'],
|
|
||||||
'master_name' => $company['master_name'],
|
|
||||||
'master_id_card' => $company['master_id_card'],
|
|
||||||
'master_email' => $company['master_email'],
|
|
||||||
'master_phone' => $company['master_phone'],
|
|
||||||
'id' => $company['id'],
|
|
||||||
];
|
|
||||||
$res = app(JunziqianController::class)->organizationFaceCreate($data);
|
|
||||||
if ($res->success == true && !empty($res->data)) {
|
|
||||||
return $this->success('成功',["faceCreateUrl"=>$res->data],1, 1);
|
|
||||||
} else {
|
} else {
|
||||||
return $this->fail($res->msg);
|
return $this->fail($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private function companyCheck($company) {
|
private function companyCheck($company) {
|
||||||
if (empty($company)) {
|
if (empty($company)) {
|
||||||
|
@ -429,8 +429,12 @@ class IndexController extends BaseApiController
|
|||||||
try {
|
try {
|
||||||
if ($parmas) {
|
if ($parmas) {
|
||||||
$data=json_decode($parmas['data'],true);
|
$data=json_decode($parmas['data'],true);
|
||||||
|
if($data['status']==1){
|
||||||
|
Company::where('id', $parmas['id'])->update(['is_authentication' => 1]);
|
||||||
|
}
|
||||||
if($data['status']==2){
|
if($data['status']==2){
|
||||||
Company::where('id', $parmas['id'])->update(['is_authentication' => 2]);
|
// 记录认证失败原因
|
||||||
|
Db::name('company_authentication_fail_log')->insert(['company_id'=>$parmas['id'],'fail_reason'=>$data['msg']]);
|
||||||
}
|
}
|
||||||
return json(['success' => true, 'msg' => '成功']);
|
return json(['success' => true, 'msg' => '成功']);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user