get('id');
$type = Request()->get('type');
$msg='合同不存在';
if(empty($type)){
$msg='参数错误';
}
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(){
$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 ' ';
}
}