账号实名

This commit is contained in:
“wanyongkang”
2021-04-06 17:46:37 +08:00
parent 620cc9c94e
commit 3ea67e7bc5
3 changed files with 56 additions and 0 deletions

View File

@@ -3,6 +3,8 @@
namespace app\product\controller;
use app\product\model\Product as PoductModel;
use app\product\model\ProductAccount as AccountModel;
use app\product\model\User as UserModel;
class OpenProduct
{
@@ -17,4 +19,29 @@ class OpenProduct
$list = $product->getList([], 'Id,Name', 'Sort asc');
\result($list);
}
//根据账号搜索用户是否实名
public function getVerify()
{
$account = json_decode(file_get_contents("php://input"), true)['account'];
if(trim($account)){
$account_model = new AccountModel;
$user = new UserModel;
$user_id = $account_model->getOne(['Account' => $account],'UserId,Account,ProductName');
$user_info = $user->getOne(['Id'=>$user_id['UserId']],'Name,Phone,id_code,is_verify');
$return_indo = [
'product'=>$user_info['ProductName'],
'account'=>$account,
'name'=>mb_substr($user_info['Name'], 0, 1) . '**',
'id_code'=>mb_substr($user_info['id_code'], 0, 3) . '***',
'phone'=>mb_substr($user_info['Phone'], 0, 3) . '***',
'verify'=> $user_info['is_verify'] == 1?'已通过支付宝扫脸认证':'',
];
echo json_encode($return_indo);
}
}
}