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
6a37de71
Commit
6a37de71
authored
Feb 02, 2021
by
蔡闯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增租客审核
parent
cf7575fb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
12 deletions
+37
-12
app/BaseController.php
app/BaseController.php
+7
-0
app/api/controller/Index.php
app/api/controller/Index.php
+30
-8
app/api/controller/Payorder.php
app/api/controller/Payorder.php
+0
-4
No files found.
app/BaseController.php
View file @
6a37de71
...
...
@@ -35,6 +35,13 @@ abstract class BaseController
'gas'
=>
'元/立方米'
,
'property'
=>
'元/平方米'
];
protected
$userType
=
[
'0'
=>
'房主'
,
'1'
=>
'家人'
,
'2'
=>
' 租客'
,
'3'
=>
'替换业主'
];
/**
* Request实例
* @var \think\Request
...
...
app/api/controller/Index.php
View file @
6a37de71
...
...
@@ -142,6 +142,7 @@ class Index extends Base
//当前用户的所有的房间列表
public
function
allVacancy
()
{
$uid
=
$this
->
uid
;
$userType
=
$this
->
userType
;
$where
[]
=
[
'hub.uid'
,
'='
,
$uid
];
$page
=
Request
::
param
(
'page'
,
1
);
$data
=
Db
::
name
(
'house_user_bind'
)
->
alias
(
'hub'
)
->
where
(
$where
)
...
...
@@ -162,6 +163,7 @@ class Index extends Base
$data
[
$k
][
'cars'
]
=
$cars
[
0
];
}
$data
[
$k
][
'car_total'
]
=
$car_total
;
$data
[
$k
][
'type_zh'
]
=
$userType
[
$v
[
'type'
]];
}
$total
=
Db
::
name
(
'house_user_bind'
)
->
alias
(
'hub'
)
->
where
(
$where
)
->
count
();
$res
[
'total'
]
=
$total
;
...
...
@@ -255,6 +257,7 @@ class Index extends Base
$uid
=
$this
->
uid
;
$where
[]
=
[
'hub.uid'
,
'='
,
$uid
];
$where
[]
=
[
'hub.house_user_bind_id'
,
'='
,
$bind_id
];
$where
[]
=
[
'hub.status'
,
'='
,
1
];
$data
=
Db
::
name
(
'house_user_bind'
)
->
alias
(
'hub'
)
->
where
(
$where
)
->
leftJoin
(
'house_vacancy hv'
,
'hv.vacancy_id = hub.vacancy_id'
)
->
leftJoin
(
'house_village hvi'
,
'hvi.village_id = hub.village_id'
)
...
...
@@ -264,12 +267,14 @@ class Index extends Base
$data
[
'vacancy_address'
]
=
$res
[
'vacancy_address'
];
if
(
$data
[
'type'
]
==
0
){
//查询家属
$
data
[
'family'
]
=
$this
->
getFamily
(
$data
[
'vacancy_id'
]);
$
family
=
$this
->
getFamily
(
$data
[
'vacancy_id'
]);
//查询租客
$
data
[
'tenant'
]
=
$this
->
getTenant
(
$data
[
'vacancy_id'
]);
$
tenant
=
$this
->
getTenant
(
$data
[
'vacancy_id'
]);
$data
[
'user'
]
=
array_merge
(
$family
,
$tenant
);
}
elseif
(
$data
[
'type'
]
==
2
){
$data
[
'tenant'
]
=
$this
->
getTenant
(
$data
[
'vacancy_id'
]);
$data
[
'user'
]
=
$this
->
getTenant
(
$data
[
'vacancy_id'
]);
}
...
...
@@ -283,34 +288,51 @@ class Index extends Base
//查询租客
$tenant
=
Db
::
name
(
'house_user_bind'
)
->
alias
(
'hub'
)
->
leftJoin
(
'user'
,
'user.uid = hub.uid'
)
->
where
([
'hub.vacancy_id'
=>
$vacancy_id
,
'hub.type'
=>
2
])
->
field
(
'hub.name,hub.phone,user.avatar,user.uid,hub.village_id'
)
->
select
()
->
toArray
();
->
where
(
'hub.status'
,
'<>'
,
3
)
->
where
(
'hub.uid'
,
'<>'
,
null
)
->
field
(
'hub.name,hub.phone,user.avatar,user.uid,hub.village_id,hub.status,hub.type'
)
->
select
()
->
toArray
();
foreach
(
$tenant
as
$k
=>
$v
)
{
$car
=
Db
::
name
(
'car'
)
->
where
([
'uid'
=>
$v
[
'uid'
],
'village_id'
=>
$v
[
'village_id'
]])
->
select
()
->
toArray
();
$tenant
[
$k
][
'cars'
]
=
$car
;
$tenant
[
$k
][
'car_total'
]
=
count
(
$car
);
$family
[
$k
][
'type_zh'
]
=
"租客"
;
}
return
$tenant
;
}
//根据房间id,查询家属
public
function
getFamily
(
$vacancy_id
)
{
//查询租客
$family
=
Db
::
name
(
'house_user_bind'
)
->
alias
(
'hub'
)
->
leftJoin
(
'user'
,
'user.uid = hub.uid'
)
->
where
([
'hub.vacancy_id'
=>
$vacancy_id
,
'hub.type'
=>
1
])
->
where
(
'hub.status'
,
'<>'
,
3
)
->
where
(
'hub.uid'
,
'<>'
,
null
)
->
field
(
'hub.house_user_bind_id,hub.village_id,hub.name,hub.phone,user.avatar,hub.uid'
)
->
select
()
->
toArray
();
->
field
(
'hub.house_user_bind_id,hub.village_id,hub.name,hub.phone,user.avatar,hub.uid
,hub.status,hub.type
'
)
->
select
()
->
toArray
();
foreach
(
$family
as
$k
=>
$v
)
{
$car
=
Db
::
name
(
'car'
)
->
where
([
'uid'
=>
$v
[
'uid'
],
'village_id'
=>
$v
[
'village_id'
]])
->
select
()
->
toArray
();
$family
[
$k
][
'cars'
]
=
$car
;
$family
[
$k
][
'car_total'
]
=
count
(
$car
);
$family
[
$k
][
'type_zh'
]
=
"家属"
;
}
return
$family
;
}
//业主审核租客和家属,或家属租客申请解绑
public
function
changeStatus
()
{
$bind_id
=
Request
::
param
(
'bind_id'
);
$status
=
Request
::
param
(
'status'
);
//1接受,0拒绝,4申请解绑,3已解绑
$save
[
'status'
]
=
$status
;
$save
[
'pass_time'
]
=
time
();
$change
=
Db
::
name
(
'house_user_bind'
)
->
where
([
'house_user_bind_id'
=>
$bind_id
])
->
save
(
$save
);
if
(
$change
)
{
return
$this
->
returnJson
();
}
else
{
return
$this
->
returnJson
([],
'操作失败!'
,
400
);
}
}
...
...
app/api/controller/Payorder.php
View file @
6a37de71
...
...
@@ -265,7 +265,6 @@ class Payorder extends Base
$limit
=
count
(
$property_cost_ids
);
$cost_property_ids
=
Db
::
name
(
'cost'
)
->
where
(
$where
)
->
where
(
$whereOne
)
->
limit
(
$limit
)
->
column
(
'cost_id'
);
if
(
$cost_property_ids
!=
$property_cost_ids
)
{
return
$this
->
returnJson
([],
'物业费缴费必须连续!'
,
400
);
}
}
...
...
@@ -348,14 +347,11 @@ class Payorder extends Base
//更改订单的支付方式
Db
::
name
(
'pay_order'
)
->
where
([
'order_id'
=>
$order_id
])
->
save
([
'pay_type'
=>
"微信"
]);
}
return
$this
->
returnJson
(
$res
);
}
else
{
return
$this
->
returnJson
([],
'非法的订单信息!'
,
400
);
}
}
//获取支付宝支付参数
public
function
getAliPaySign
(
$param
)
{
require_once
"../extend/aliPay/AopClient.php"
;
...
...
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