Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
ruer_cms
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蔡闯
ruer_cms
Commits
f30d1b87
Commit
f30d1b87
authored
Feb 04, 2021
by
蔡闯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物业服务时间修改
parent
89bc9a1f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
510 additions
and
477 deletions
+510
-477
app/api/controller/Index.php
app/api/controller/Index.php
+31
-34
app/api/controller/Payreturn.php
app/api/controller/Payreturn.php
+7
-1
app/shequ/controller/Vacancy.php
app/shequ/controller/Vacancy.php
+472
-442
No files found.
app/api/controller/Index.php
View file @
f30d1b87
...
...
@@ -157,9 +157,6 @@ class Index extends Base
$cars
=
Db
::
name
(
'car'
)
->
where
([
'uid'
=>
$this
->
uid
,
'village_id'
=>
$v
[
'village_id'
]])
->
field
(
'car_id,license_plate,brand'
)
->
select
()
->
toArray
();
$data
[
$k
][
'cars'
]
=
$cars
;
$car_total
=
count
(
$cars
);
if
(
$car_total
==
1
)
{
$data
[
$k
][
'cars'
]
=
$cars
[
0
];
}
$data
[
$k
][
'car_total'
]
=
$car_total
;
$data
[
$k
][
'type_zh'
]
=
$userType
[
$v
[
'type'
]];
}
...
...
@@ -174,33 +171,32 @@ class Index extends Base
return
$this
->
returnJson
(
$data
);
}
//修改车辆
public
function
changeCar
()
{
$car_id
=
Request
::
param
(
'car_id'
);
$data
[
'license_plate'
]
=
Request
::
param
(
'license_plate'
);
$is_exit
=
Db
::
name
(
'car'
)
->
where
(
'uid'
,
'<>'
,
$this
->
uid
)
->
where
(
$data
)
->
find
();
if
(
$is_exit
){
return
$this
->
returnJson
([],
'该车牌号已存在!'
,
400
);
}
$data
[
'name'
]
=
Request
::
param
(
'name'
);
$data
[
'car_color'
]
=
Request
::
param
(
'car_color'
);
$data
[
'village_id'
]
=
Request
::
param
(
'village_id'
);
$data
[
'brand'
]
=
Request
::
param
(
'brand'
);
$data
[
'car_type'
]
=
Request
::
param
(
'car_type'
);
$data
[
'car_color'
]
=
Request
::
param
(
'car_color'
);
$change
=
Db
::
name
(
'car'
)
->
where
([
'car_id'
=>
$car_id
])
->
save
(
$data
);
if
(
$change
)
{
return
$this
->
returnJson
([],
'操作成功!'
);
}
else
{
return
$this
->
returnJson
([],
'操作失败!'
,
400
);
}
}
// //修改车辆
// public function changeCar() {
// $car_id = Request::param('car_id');
// $data['license_plate'] = Request::param('license_plate');
// $is_exit = Db::name('car')->where('uid','<>',$this->uid)->where($data)->find();
// if($is_exit){
// return $this->returnJson([],'该车牌号已存在!',400);
// }
// $data['name'] = Request::param('name');
// $data['car_color'] = Request::param('car_color');
// $data['village_id'] = Request::param('village_id');
// $data['brand'] = Request::param('brand');
// $data['car_type'] = Request::param('car_type');
//
// $change = Db::name('car')->where(['car_id'=>$car_id])->save($data);
//
// if($change) {
// return $this->returnJson([],'操作成功!');
// } else {
// return $this->returnJson([],'操作失败!',400);
// }
//
// }
//用户添加车辆
public
function
add
Car
()
{
public
function
change
Car
()
{
$uid
=
$this
->
uid
;
$car_id
=
Request
::
param
(
'car_id'
);
$data
[
'phone'
]
=
Db
::
name
(
'user'
)
->
where
([
'uid'
=>
$uid
])
->
value
(
'phone'
);
...
...
@@ -209,11 +205,11 @@ class Index extends Base
$data
[
'car_color'
]
=
Request
::
param
(
'car_color'
);
$data
[
'license_plate'
]
=
Request
::
param
(
'license_plate'
);
$data
[
'sort_id'
]
=
Request
::
param
(
'sort_id'
,
1
);
$data
[
'car_type'
]
=
Request
::
param
(
'car_type'
);
$data
[
'uid'
]
=
$uid
;
$data
[
'village_id'
]
=
Request
::
param
(
'village_id'
);
$data
[
'car_color'
]
=
Request
::
param
(
'car_color'
);
if
(
$car_id
)
{
//判断车牌是否存在
//判断车牌是否存在
changeCar
$is_exit
=
Db
::
name
(
'car'
)
->
where
([
'license_plate'
=>
$data
[
'license_plate'
]])
->
where
(
'car_id'
,
'<>'
,
$car_id
)
->
find
();
if
(
$is_exit
)
{
return
$this
->
returnJson
([],
'系统中已存在该车牌!'
,
400
);
...
...
@@ -228,10 +224,11 @@ class Index extends Base
}
$operation
=
Db
::
name
(
'car'
)
->
save
(
$data
);
}
if
(
$operation
)
{
if
(
$operation
!==
false
)
{
return
$this
->
returnJson
([],
'success'
);
}
else
{
return
$this
->
returnJson
([],
'
操作
失败!'
,
400
);
return
$this
->
returnJson
([],
'
修改
失败!'
,
400
);
}
}
...
...
@@ -239,7 +236,7 @@ class Index extends Base
public
function
deleteCar
()
{
$car_id
=
Request
::
param
(
'car_id'
);
$delete
=
Db
::
name
(
'car'
)
->
where
([
'car_id'
=>
$car_id
,
'uid'
=>
$this
->
uid
])
->
delete
();
if
(
$delete
)
{
if
(
$delete
!==
false
)
{
return
$this
->
returnJson
();
}
else
{
return
$this
->
returnJson
([],
'删除失败!'
,
400
);
...
...
@@ -319,7 +316,7 @@ class Index extends Base
$save
[
'status'
]
=
$status
;
$save
[
'pass_time'
]
=
time
();
$change
=
Db
::
name
(
'house_user_bind'
)
->
where
([
'house_user_bind_id'
=>
$bind_id
])
->
save
(
$save
);
if
(
$change
)
{
if
(
$change
!==
false
)
{
return
$this
->
returnJson
();
}
else
{
return
$this
->
returnJson
([],
'操作失败!'
,
400
);
...
...
app/api/controller/Payreturn.php
View file @
f30d1b87
...
...
@@ -48,17 +48,23 @@ class Payreturn extends BaseController
}
}
//根据获取到的订单id,更改状态
//根据获取到的订单id,更改状态
,更改房间的物业服务时间
private
function
changePayStatus
(
$out_trade_no
)
{
$where
[
'order_num'
]
=
$out_trade_no
;
$save
[
'pay_time'
]
=
time
();
$save
[
'is_pay'
]
=
1
;
$cost_ids
=
DB
::
name
(
'pay_order'
)
->
where
([
'order_num'
=>
$out_trade_no
])
->
value
(
'cost_ids'
);
$cost_ids_arr
=
json_decode
(
$cost_ids
);
$costInfo
=
Db
::
name
(
'cost'
)
->
where
(
'cost_id'
,
'in'
,
$cost_ids_arr
)
->
where
([
'type'
=>
'property'
])
->
order
(
'cost_month'
,
'desc'
)
->
field
(
'cost_month,vacancy_id'
)
->
find
();
Db
::
startTrans
();
try
{
if
(
$costInfo
)
{
$property_end_time
=
$costInfo
[
'cost_month'
];
DB
::
name
(
'house_vacancy'
)
->
where
([
'vacancy_id'
=>
$costInfo
[
'vacancy_id'
]])
->
save
([
'property_end_time'
=>
$property_end_time
]);
}
Db
::
name
(
'pay_order'
)
->
where
(
$where
)
->
save
(
$save
);
Db
::
name
(
'cost'
)
->
where
(
'cost_id'
,
'in'
,
$cost_ids_arr
)
->
save
(
$save
);
Db
::
commit
();
return
true
;
}
catch
(
\Exception
$e
){
...
...
app/shequ/controller/Vacancy.php
View file @
f30d1b87
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment