Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
0a41c755
Commit
0a41c755
authored
Jul 10, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
site_id
parent
2c51e299
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
4 deletions
+36
-4
Transfer.php
application/index/controller/Transfer.php
+4
-2
SubletModel.php
application/model/SubletModel.php
+32
-2
No files found.
application/index/controller/Transfer.php
View file @
0a41c755
...
...
@@ -71,6 +71,8 @@ class Transfer extends Basic
$where
[
'a.shop_name'
]
=
[
'like'
,
$params
[
'shop_name'
]
.
'%'
];
}
$where
[
'a.city'
]
=
$this
->
city
;
$where
[
'd.site_id'
]
=
$this
->
siteId
;
if
(
!
empty
(
$params
[
'agent_id'
]))
{
$where
[
'c.agent_id'
]
=
$params
[
'agent_id'
];
}
else
{
...
...
@@ -88,9 +90,9 @@ class Transfer extends Basic
$fields
=
'a.id,a.shop_name,a.manage_type,a.address_detail,a.province,a.city,a.district,FORMAT(a.expected_rent/100,2) as expected_rent,
if(b.status=2,"3",a.status) as status,a.appellation,a.tel,a.create_time,a.status'
;
$data
[
'list'
]
=
$sublet
->
getSublet
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields
,
$where
);
$data
[
'list'
]
=
$sublet
->
getSublet
Agent
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields
,
$where
);
$data
[
'total'
]
=
$sublet
->
getSubletTotal
(
$where
);
$data
[
'total'
]
=
$sublet
->
getSublet
Agent
Total
(
$where
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
);
...
...
application/model/SubletModel.php
View file @
0a41c755
...
...
@@ -58,17 +58,47 @@ class SubletModel extends BaseModel
return
$result
;
}
/**
* 查询转铺记录
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $fields
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getSubletAgent
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
''
,
$fields
=
'*'
,
$params
=
''
)
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
"a"
)
->
join
(
"g_houses b"
,
"a.house_id=b.id"
,
"left"
)
->
join
(
"u_user_agent d"
,
"a.user_id=d.user_id"
,
"left"
)
->
join
(
"u_users c"
,
"d.user_id = c.id"
,
"left"
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
// big_log($this->getLastSql());
return
$result
;
}
/**
* 查询转铺总记录数
*
* @param $params
* @return int|string
*/
public
function
getSubletTotal
(
$params
)
public
function
getSublet
Agent
Total
(
$params
)
{
$result
=
$this
->
alias
(
"a"
)
->
join
(
"g_houses b"
,
"a.house_id=b.id"
,
"left"
)
->
join
(
"u_users c"
,
"a.user_id = c.id"
,
"left"
)
->
join
(
"u_user_agent d"
,
"a.user_id=d.user_id"
,
"left"
)
->
join
(
"u_users c"
,
"d.user_id = c.id"
,
"left"
)
->
where
(
$params
)
->
count
();
return
$result
;
...
...
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