Commit 0b940e82 authored by 蔡闯's avatar 蔡闯

修改物业服务时间

parent 437491c4
...@@ -8,6 +8,7 @@ class Base extends \app\BaseController ...@@ -8,6 +8,7 @@ class Base extends \app\BaseController
public function __construct(\think\App $app) public function __construct(\think\App $app)
{ {
;
parent::__construct($app); parent::__construct($app);
if(Request::header("token")){ if(Request::header("token")){
......
<?php <?php
// 应用公共文件 // 应用公共文件
/** /**
* @param $url * @param $url
* @return array * @return array
......
...@@ -898,12 +898,7 @@ class Common extends BaseController ...@@ -898,12 +898,7 @@ class Common extends BaseController
} }
$savename = \think\facade\Filesystem::putFile($path, $file); $savename = \think\facade\Filesystem::putFile($path, $file);
// if(isHTTPS()){
// $http = "https://";
// } else {
// $http = "http://";
// }
// $data['path'] = $http.$_SERVER['SERVER_NAME']."/upload/".$savename;
$data['data'] = "/upload/".$savename; $data['data'] = "/upload/".$savename;
return $data; return $data;
......
...@@ -79,7 +79,6 @@ class News extends Base ...@@ -79,7 +79,6 @@ class News extends Base
$add = Db::name('news')->where($where)->save($data); $add = Db::name('news')->where($where)->save($data);
} else { } else {
$add = Db::name('news')->save($data); $add = Db::name('news')->save($data);
} }
if($add) { if($add) {
return $this->returnJson([],'success'); return $this->returnJson([],'success');
...@@ -169,7 +168,6 @@ class News extends Base ...@@ -169,7 +168,6 @@ class News extends Base
$add = Db::name('notice')->where($where)->save($data); $add = Db::name('notice')->where($where)->save($data);
} else { } else {
$add = Db::name('notice')->save($data); $add = Db::name('notice')->save($data);
} }
if($add) { if($add) {
return $this->returnJson([],'success'); return $this->returnJson([],'success');
......
...@@ -77,16 +77,15 @@ class Vacancy extends Base ...@@ -77,16 +77,15 @@ class Vacancy extends Base
} else { } else {
$res = $this->checkVacancyCode($vacancy_code,0,$data['layout_id'] ); $res = $this->checkVacancyCode($vacancy_code,0,$data['layout_id'] );
} }
if($res['code'] !=200) {
if($res['code'] != 200) {
return $this->returnJson([],$res['msg'],400); return $this->returnJson([],$res['msg'],400);
} }
$data['vacancy_code'] = $vacancy_code ; $data['vacancy_code'] = $vacancy_code ;
$data['name'] = $add['name'] = Request::param('name'); //业主姓名 $data['name'] = $add['name'] = Request::param('name'); //业主姓名
$data['id_card'] = $add['id_card'] = Request::param('id_card'); //身份证id / $data['id_card'] = $add['id_card'] = Request::param('id_card'); //身份证id /
$phone = Request::param('phone'); //业主手机号 $phone = Request::param('phone'); //业主手机号
if(!isPhoneNo($phone)) {
return $this->returnJson([],'手机号不合法!',400);
}
$data['phone'] = $add['phone']= $phone; $data['phone'] = $add['phone']= $phone;
if(Request::param('property_start_time') && Request::param('property_end_time')) { if(Request::param('property_start_time') && Request::param('property_end_time')) {
$data['property_start_time'] = date('Y-m',strtotime(Request::param('property_start_time'))); $data['property_start_time'] = date('Y-m',strtotime(Request::param('property_start_time')));
...@@ -129,7 +128,7 @@ class Vacancy extends Base ...@@ -129,7 +128,7 @@ class Vacancy extends Base
$data['park_car_id'] = $is_exit['park_car_id']; $data['park_car_id'] = $is_exit['park_car_id'];
} }
if($vacancy_id) { //修改 if($vacancy_id) { //修改
$operation = Db::name('house_vacancy')->where(['vacancy_id'=>$vacancy_id])->update($data); $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); $change = Db::name('house_user_bind')->where(['vacancy_id'=>$vacancy_id])->save($add);
if($operation || $change) { if($operation || $change) {
return $this->returnJson([],'success'); return $this->returnJson([],'success');
...@@ -196,14 +195,15 @@ class Vacancy extends Base ...@@ -196,14 +195,15 @@ class Vacancy extends Base
//查看布局是否黑 //查看布局是否黑
$layoutCode = Db::name('layout_list')->where(['layout_id'=>$layout_id])->value('code'); $layoutCode = Db::name('layout_list')->where(['layout_id'=>$layout_id])->value('code');
if(count($array) != count(explode('-',$layoutCode))){ if(count($array) != count(explode('-',$layoutCode))){
return ['code'=>400,'msg'=>'房间位置不合法!']; return ['code'=>400,'msg'=>'物业编号不合法!'];
} }
//去掉最后一个房间编号的 //去掉最后一个房间编号的
array_pop($array); array_pop($array);
$count = Db::name('layout_build')->where('layout_build_id','in',$array)->count(); $count = Db::name('layout_build')->where('layout_build_id','in',$array)->count();
if($count != count($array)) { if($count != count($array)) {
return ['code'=>400,'msg'=>'房间位置不合法!']; return ['code'=>400,'msg'=>'物业编号不合法!'];
} else { } else {
return ['code'=>200,'msg'=>'success!']; return ['code'=>200,'msg'=>'success!'];
} }
...@@ -211,16 +211,16 @@ class Vacancy extends Base ...@@ -211,16 +211,16 @@ class Vacancy extends Base
} }
//判断输入的物业开始时间和结束时间是否合理 //判断输入的物业开始时间和结束时间是否合理
public function checkVacancyPropertyTime($stat_time,$end_time){ public function checkVacancyPropertyTime($start_time,$end_time){
if($stat_time ==$end_time) { if($start_time ==$end_time) {
return ['code'=>400,'msg'=>"开始时间和结束时间不能相同!"]; return ['code'=>400,'msg'=>"开始时间和结束时间不能相同!"];
} }
$new_time = date('Y-m',time()); $new_time = date('Y-m',time());
if($stat_time == $new_time) { if($start_time == $new_time) {
return ['code'=>400,'msg'=>"开始时间不能早于当前月份!"]; return ['code'=>400,'msg'=>"开始时间不能早于当前月份!"];
} }
if($stat_time > $end_time || $stat_time =$end_time) { if($start_time > $end_time) {
return ['code'=>400,'msg'=>"开始时间不能大于结束时间!"]; return ['code'=>400,'msg'=>"开始时间不能大于结束时间!"];
} }
...@@ -231,7 +231,7 @@ class Vacancy extends Base ...@@ -231,7 +231,7 @@ class Vacancy extends Base
return ['code'=>400,'msg'=>"结束时间不能设置不能超过2年!"]; return ['code'=>400,'msg'=>"结束时间不能设置不能超过2年!"];
} }
return ['code'=>200,'msg'=>"success!"];
} }
//通过房间编号获取房间地址 //通过房间编号获取房间地址
......
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