Commit 88924aee authored by 蔡闯's avatar 蔡闯

2021-3-2

parent 358676e5
......@@ -78,7 +78,7 @@ class Vacancy extends Base
$res = $this->checkVacancyCode($vacancy_code,0,$data['layout_id'] );
}
if($res['code'] != 200) {
echo -1;
return $this->returnJson([],$res['msg'],400);
}
$data['vacancy_code'] = $vacancy_code ;
......@@ -86,17 +86,19 @@ class Vacancy extends Base
$data['id_card'] = $add['id_card'] = Request::param('id_card'); //身份证id /
$phone = Request::param('phone'); //业主手机号
$data['phone'] = $add['phone']= $phone;
if(Request::param('property_start_time') && Request::param('property_end_time')) {
$data['property_start_time'] = date('Y-m',strtotime(Request::param('property_start_time')));
if(Request::param('property_end_time')) {
$data['property_start_time'] = date('Y-m',1577808000); //设置2020-1-1为默认开始时间
$data['property_end_time'] = date('Y-m',strtotime(Request::param('property_end_time')));
if($data['property_start_time'] && $data['property_end_time']) {
//判断物业服务开始时间和结束时间是否合理
$res = $this->checkVacancyPropertyTime($data['property_start_time'],$data['property_end_time']);
if($res['code'] !=200) {
echo 0;
return $this->returnJson([],$res['msg'],400);
}
}
// if($data['property_start_time'] && $data['property_end_time']) {
// //判断物业服务开始时间和结束时间是否合理
// $res = $this->checkVacancyPropertyTime($data['property_start_time'],$data['property_end_time']);
// if($res['code'] !=200) {
//
// return $this->returnJson([],$res['msg'],400);
// }
// }
}
$data['village_name'] = Db::name('house_village')->where(['village_id'=>$data['village_id']])->value('village_name');
$data['area'] = Request::param('area');
......@@ -131,10 +133,9 @@ class Vacancy extends Base
$operation = Db::name('house_vacancy')->where(['vacancy_id'=>$vacancy_id])->save($data);
$change = Db::name('house_user_bind')->where(['vacancy_id'=>$vacancy_id])->save($add);
if($operation || $change ) {
echo 1;
return $this->returnJson([],'success');
} else {
echo 2;
return $this->returnJson([],'error',400);
}
} else {
......@@ -143,7 +144,7 @@ class Vacancy extends Base
try{
$operation = Db::name('house_vacancy')->insertGetId($data);
$add['vacancy_id'] = $operation;
$change = Db::name('house_user_bind')->save($add);
Db::name('house_user_bind')->save($add);
Db::commit();
return $this->returnJson([],'success');
}catch(\Exception $e){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment