作者 郭鑫

需求修改

... ... @@ -237,6 +237,28 @@ class UserneedController extends CommonController
}
// 加数据库
$data = $request->Post();
if(empty($data['code'])){
Db::rollback();
$this->apiResponse('0','验证码不能为空');
}else{
$code = $data['code'];
}
$where_code['tel'] = $data['tel'];
$where_code['type'] = 3;
$where_code['create_time'] = array('egt',(time()-300));
$find_code = Db::name('Code')->where($where_code)->order('create_time desc')->field('code')->find();
if(!$find_code){
Db::rollback();
$this->apiResponse('0','验证码错误,请重新获取');
}
if($code != $find_code['code']){
Db::rollback();
$this->apiResponse('0','验证码错误,请重新获取');
}else{
$updateCode['status'] = 9;
Db::name('Code')->where($where_code)->update($updateCode);
}
// 保证金
$city = $data['city'];
$area = $data['area'];
... ...