|
|
@@ -955,7 +955,6 @@ class User extends BaseController
|
|
955
|
955
|
$params['create_time'] = time();
|
|
956
|
956
|
$params['uid'] = $member_id;
|
|
957
|
957
|
$baidu = new Ocr();
|
|
958
|
|
-
|
|
959
|
958
|
// 兼容港澳台证件
|
|
960
|
959
|
if ($cardType != 1) {
|
|
961
|
960
|
// 设置exitentrypermit_type
|
|
|
@@ -983,6 +982,7 @@ class User extends BaseController
|
|
983
|
982
|
if ($real_user_card != $params['user_card']) {
|
|
984
|
983
|
return app('json')->fail('姓名或身份证号输入有误~');
|
|
985
|
984
|
}
|
|
|
985
|
+
|
|
986
|
986
|
$params['reason'] = '';
|
|
987
|
987
|
$params['audit_time'] = 0;
|
|
988
|
988
|
$params['update_time'] = 0;
|
|
|
@@ -1018,6 +1018,7 @@ class User extends BaseController
|
|
1018
|
1018
|
$image = file_get_contents($params['card_positive']);
|
|
1019
|
1019
|
$idCardSide = "front";
|
|
1020
|
1020
|
$result = $baidu->idcard($image, $idCardSide);
|
|
|
1021
|
+ Log::info('hkMacauTaiwan:' . json_encode($result));
|
|
1021
|
1022
|
$real_user_name = $result['words_result']['姓名']['words'] ?? '';
|
|
1022
|
1023
|
$real_user_card = $result['words_result']['公民身份号码']['words'] ?? '';
|
|
1023
|
1024
|
if ($real_user_name != $params['user_name']) {
|
|
|
@@ -1028,6 +1029,7 @@ class User extends BaseController
|
|
1028
|
1029
|
}
|
|
1029
|
1030
|
if ($result['image_status'] == "normal" && $result['idcard_number_type'] == 1) {
|
|
1030
|
1031
|
$params['status'] = 1;
|
|
|
1032
|
+ $params['card_type'] = $cardType;
|
|
1031
|
1033
|
$res = $this->repository->add_cer($params, $member_id);
|
|
1032
|
1034
|
if ($res) {
|
|
1033
|
1035
|
$userRepository = app()->make(UserRepository::class);
|
|
|
@@ -1050,6 +1052,7 @@ class User extends BaseController
|
|
1050
|
1052
|
return app('json')->fail('认证失败,请重新认证');
|
|
1051
|
1053
|
}
|
|
1052
|
1054
|
}
|
|
|
1055
|
+
|
|
1053
|
1056
|
}
|
|
1054
|
1057
|
|
|
1055
|
1058
|
|
|
|
@@ -3370,39 +3373,11 @@ class User extends BaseController
|
|
3370
|
3373
|
|
|
3371
|
3374
|
public function getAmountFromGzc()
|
|
3372
|
3375
|
{
|
|
3373
|
|
-// $uid = $this->request->uid();
|
|
3374
|
|
-// $userInfo = Db::name('UserCertification')->where('uid', $uid)->field('user_name,user_card')->find();
|
|
3375
|
|
-// $res = GzcApiRequest::checkAmount($userInfo);
|
|
3376
|
|
-//
|
|
3377
|
|
-// return app('json')->success(['amount' => sprintf("%01.2f", $res['extendData']['amount'] * 0.01)]);
|
|
3378
|
3376
|
$uid = $this->request->uid();
|
|
3379
|
3377
|
$userInfo = Db::name('UserCertification')->where('uid', $uid)->field('user_name,user_card')->find();
|
|
|
3378
|
+ $res = GzcApiRequest::checkAmount($userInfo);
|
|
3380
|
3379
|
|
|
3381
|
|
- if (empty($userInfo['user_name']) || empty($userInfo['user_card'])) {
|
|
3382
|
|
- Log::error('[getAmountFromGzc] 用户实名信息缺失', ['uid' => $uid, 'userInfo' => $userInfo]);
|
|
3383
|
|
- return app('json')->fail('未找到用户实名信息');
|
|
3384
|
|
- }
|
|
3385
|
|
-
|
|
3386
|
|
- try {
|
|
3387
|
|
- $res = GzcApiRequest::checkAmount($userInfo);
|
|
3388
|
|
- } catch (\Throwable $e) {
|
|
3389
|
|
- Log::error('[getAmountFromGzc] 调用异常', ['uid' => $uid, 'error' => $e->getMessage()]);
|
|
3390
|
|
- return app('json')->fail('查询失败(第三方异常)');
|
|
3391
|
|
- }
|
|
3392
|
|
-
|
|
3393
|
|
- // 提取 amount(兼容多种字段位置)
|
|
3394
|
|
- $amountCents = $res['extendData']['amount'] ?? $res['data']['amount'] ?? $res['amount'] ?? null;
|
|
3395
|
|
- $amount = $amountCents === null ? 0.0 : floatval($amountCents) * 0.01;
|
|
3396
|
|
- $formatted = sprintf('%.2f', $amount);
|
|
3397
|
|
-
|
|
3398
|
|
- // 从 checkAmount 返回的 debug(若存在)
|
|
3399
|
|
- $debug = $res['debug'] ?? null;
|
|
3400
|
|
-
|
|
3401
|
|
- // 返回 amount 与 debug 给调用方(前端 / 调试)
|
|
3402
|
|
- return app('json')->success([
|
|
3403
|
|
- 'amount' => $formatted,
|
|
3404
|
|
- 'debug' => $debug
|
|
3405
|
|
- ]);
|
|
|
3380
|
+ return app('json')->success(['amount' => sprintf("%01.2f", $res['extendData']['amount'] * 0.01)]);
|
|
3406
|
3381
|
}
|
|
3407
|
3382
|
|
|
3408
|
3383
|
public function check_user_annual_fee()
|