get('id');
$type = Request()->get('type');
$params = Request()->param();
$msg='合同不存在';
if(empty($type)){
$msg='参数错误';
}
if (isset($params['t']) && $params['t'] == 1) {
$find = Db::name('shop_contract')->where('id', $id)->find();
if ($find && $find['url']) {
$url = json_decode($find['url'], true);
if(isset($url[$type])){
return redirect($url[$type]);
}
}
}
if ($id && $type) {
$find = Db::name('contract')->where('id', $id)->find();
if ($find && $find['url']) {
$url = json_decode($find['url'], true);
if(isset($url[$type])){
return redirect($url[$type]);
}
}
}
return '
';
}
public function info(): \think\response\Json|string|\think\response\Redirect
{
$params = $this->request->get(['id','type']);
if(empty($params['id']) || empty($params['type'])){
return $this->fail('缺少必要参数');
}
$find = VehicleContract::where('id', $params['id'])->find();
if (!empty($find) && $find['url']) {
$url = json_decode($find['url'], true);
if(isset($url[$params['type']])){
return redirect($url[$params['type']]);
}
}
return ' ';
}
// 用户做人脸识别时,作跳板的短信链接
public function toFaceCreate(): string|\think\response\Redirect
{
$id = Request()->get('id');
$msg='地址不存在';
if ($id) {
$find = Db::name('company')->where('id', $id)->find();
if ($find && $find['face_create_url']) {
return redirect($find['face_create_url']);
} else {
$msg='参数错误';
}
}
return ' ';
}
public function notifyOrganizationFaceCreate(): string
{
$parmas = Request()->param();
Log::info(['人脸识别采集校验回调:',$parmas]);
$result = json_decode($parmas['data'], true);
$msg = '人脸采集成功';
if (isset($result['status']) && $result['status'] == 1) {
// 修改人脸采集状态
Company::where(['organization_code'=>$result['organizationRegNo']])->update(['face_create_status'=>1]);
} else {
$msg = '采集失败,原因:'.$result['msg'];
// 记录错误日志
Db::name('company_authentication_fail_log')->insert(['company_id'=>$result['orderNo'], 'log_type'=>2,'fail_reason'=>$msg, 'create_time'=>time()]);
}
return ' ';
}
}