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
29617517
Commit
29617517
authored
Jun 06, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
c32fa09e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
418 deletions
+53
-418
OfficeOReportModel.php
application/model/OfficeOReportModel.php
+53
-418
No files found.
application/model/OfficeOReportModel.php
View file @
29617517
...
...
@@ -155,7 +155,7 @@ class OfficeOReportModel extends Model
return
$this
->
db
->
field
(
$filed
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id = b.f_id"
,
"left"
)
->
join
(
"o
ffice_o
_order b"
,
"a.id = b.f_id"
,
"left"
)
->
join
(
"a_agents c"
,
"a.report_agent_id = c.id"
,
"left"
)
->
join
(
"a_store d"
,
"c.store_id = d.id"
,
"left"
)
->
where
(
$where_
)
...
...
@@ -198,8 +198,8 @@ class OfficeOReportModel extends Model
case
2
:
$result
=
$this
->
db
->
field
(
$filed
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id=b.f_id"
,
"left"
)
->
join
(
"o_march_in c"
,
"b.id=c.order_id"
,
"right"
)
->
join
(
"o
ffice_o
_order b"
,
"a.id=b.f_id"
,
"left"
)
->
join
(
"o
ffice_o
_march_in c"
,
"b.id=c.order_id"
,
"right"
)
->
where
(
$where
)
->
order
(
"b.id desc"
)
->
page
(
$pageNo
)
...
...
@@ -209,8 +209,8 @@ class OfficeOReportModel extends Model
case
3
:
$result
=
$this
->
db
->
field
(
$filed
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id=b.f_id"
,
"left"
)
->
join
(
"o_paylog c"
,
"b.id=c.order_id"
,
"right"
)
->
join
(
"o
ffice_o
_order b"
,
"a.id=b.f_id"
,
"left"
)
->
join
(
"o
ffice_o
_paylog c"
,
"b.id=c.order_id"
,
"right"
)
->
where
(
$where
)
->
order
(
"b.id desc"
)
->
page
(
$pageNo
)
...
...
@@ -221,8 +221,8 @@ class OfficeOReportModel extends Model
case
4
:
$result
=
$this
->
db
->
field
(
$filed
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id=b.f_id"
,
"left"
)
->
join
(
"o_bargain c"
,
"b.id=c.order_id"
,
"right"
)
->
join
(
"o
ffice_o
_order b"
,
"a.id=b.f_id"
,
"left"
)
->
join
(
"o
ffice_o
_bargain c"
,
"b.id=c.order_id"
,
"right"
)
->
where
(
$where
)
->
order
(
"b.id desc"
)
->
page
(
$pageNo
)
...
...
@@ -233,7 +233,7 @@ class OfficeOReportModel extends Model
default
:
$result
=
$this
->
db
->
field
(
$filed
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id=b.f_id"
,
"left"
)
->
join
(
"o
ffice_o
_order b"
,
"a.id=b.f_id"
,
"left"
)
->
where
(
$where
)
->
order
(
"b.id desc"
)
->
page
(
$pageNo
)
...
...
@@ -330,9 +330,9 @@ class OfficeOReportModel extends Model
(( SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_march_in` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
$report_agent_str
AND `a`.`status` = 0
...
...
@@ -343,9 +343,9 @@ class OfficeOReportModel extends Model
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_march_in` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
$house_str
AND `a`.`status` = 0
...
...
@@ -363,9 +363,9 @@ class OfficeOReportModel extends Model
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_paylog` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
$report_agent_str
AND `a`.`status` = 0
...
...
@@ -378,9 +378,9 @@ class OfficeOReportModel extends Model
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_paylog` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
$house_str
AND `a`.`status` = 0
...
...
@@ -398,9 +398,9 @@ class OfficeOReportModel extends Model
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_bargain` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_bargain` `c` ON `b`.`id` = `c`.`order_id`
WHERE
$report_agent_str
AND `a`.`status` = 0
...
...
@@ -413,9 +413,9 @@ class OfficeOReportModel extends Model
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_bargain` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_bargain` `c` ON `b`.`id` = `c`.`order_id`
WHERE
$house_str
AND `a`.`status` = 0
...
...
@@ -433,9 +433,9 @@ class OfficeOReportModel extends Model
((SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
LEFT JOIN `g_houses` `c` ON `b`.`house_id` = `c`.`id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
LEFT JOIN `
office_
g_houses` `c` ON `b`.`house_id` = `c`.`id`
WHERE
$report_agent_str
AND `a`.`status` = 0
...
...
@@ -444,9 +444,9 @@ class OfficeOReportModel extends Model
(SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
LEFT JOIN `g_houses` `c` ON `b`.`house_id` = `c`.`id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
LEFT JOIN `
office_
g_houses` `c` ON `b`.`house_id` = `c`.`id`
WHERE
$house_str
AND `a`.`status` = 0
...
...
@@ -519,9 +519,9 @@ class OfficeOReportModel extends Model
(( SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_march_in` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN (
$report_agent_id
)
AND `a`.`status` = 0
...
...
@@ -532,9 +532,9 @@ class OfficeOReportModel extends Model
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_march_in` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN (
$house_ids
)
AND `a`.`status` = 0
...
...
@@ -553,9 +553,9 @@ class OfficeOReportModel extends Model
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_paylog` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN (
$report_agent_id
)
AND `a`.`status` = 0
...
...
@@ -568,9 +568,9 @@ class OfficeOReportModel extends Model
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_paylog` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN (
$house_ids
)
AND `a`.`status` = 0
...
...
@@ -588,9 +588,9 @@ class OfficeOReportModel extends Model
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_bargain` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_bargain` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN (
$report_agent_id
)
AND `a`.`status` = 0
...
...
@@ -603,9 +603,9 @@ class OfficeOReportModel extends Model
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_bargain` `c` ON `b`.`id` = `c`.`order_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o
ffice_o
_bargain` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN (
$house_ids
)
AND `a`.`status` = 0
...
...
@@ -623,8 +623,8 @@ class OfficeOReportModel extends Model
((SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
`o
ffice_o
_report` `a`
LEFT JOIN `o
ffice_o
_order` `b` ON `a`.`id` = `b`.`f_id`
WHERE
`a`.`report_agent_id` IN (
$report_agent_id
)
AND `a`.`status` = 0
...
...
@@ -723,213 +723,12 @@ class OfficeOReportModel extends Model
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id = b.f_id"
,
"left"
)
->
where
(
$where_
)
->
select
();
return
$result
;
}
/**
* @param $params
* @param $field
* @param $page_no
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddReportList
(
$params
,
$field
,
$page_no
,
$page_size
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.report_agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
"house_ids"
]))
{
$where_
[
"b.house_id"
]
=
array
(
"in"
,
$params
[
"house_ids"
]
);
}
$where_
[
"a.status"
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id = b.f_id"
,
"left"
)
->
join
(
"g_houses c"
,
"b.house_id = c.id"
,
"left"
)
->
where
(
$where_
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
select
();
//echo Db::table($this->table)->getLastSql();
return
$result
;
}
/**
* @param int $pageNo 7151
* @param int $pageSize
* @param string $order_
* @param string $field
* @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
getReportList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$field
=
''
,
$params
=
''
)
{
$result
=
$this
->
db
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_agents d"
,
"a.report_agent_id = d.id"
,
"left"
)
->
join
(
"o_order b"
,
"a.id = b.f_id"
,
"left"
)
->
join
(
"g_houses c"
,
"b.house_id = c.id"
,
"left"
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order_
)
->
select
();
return
$result
;
}
/**
* 约带看总数
*
* @param $params
* @return int|string
*/
public
function
getAddReportListTotal
(
$params
)
{
return
$this
->
db
->
alias
(
"a"
)
->
join
(
"a_agents d"
,
"a.report_agent_id = d.id"
,
"left"
)
->
join
(
"o_order b"
,
"a.id = b.f_id"
,
"left"
)
->
join
(
"g_houses c"
,
"b.house_id = c.id"
,
"left"
)
->
where
(
$params
)
->
count
(
'a.id'
);
}
public
function
getAddReportListPcInfo
(
$params
,
$field
,
$page_no
,
$page_size
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.report_agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
"house_ids"
]))
{
$where_
[
"b.house_id"
]
=
array
(
"in"
,
$params
[
"house_ids"
]
);
}
$where_
[
"a.status"
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id = b.f_id"
,
"left"
)
->
join
(
"g_houses c"
,
"b.house_id = c.id"
,
"left"
)
->
join
(
'a_store e'
,
'a.report_store_id = e.id'
,
'left'
)
->
join
(
"office_o_order b"
,
"a.id = b.f_id"
,
"left"
)
->
where
(
$where_
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
select
();
//echo Db::table($this->table)->getLastSql();
return
$result
;
}
public
function
getAddReportListPcInfoTotal
(
$params
,
$field
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.report_agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
"house_ids"
]))
{
$where_
[
"b.house_id"
]
=
array
(
"in"
,
$params
[
"house_ids"
]
);
}
$where_
[
"a.status"
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id = b.f_id"
,
"left"
)
->
join
(
"g_houses c"
,
"b.house_id = c.id"
,
"left"
)
->
join
(
'a_store e'
,
'a.report_store_id = e.id'
,
'left'
)
->
where
(
$where_
)
->
count
();
//echo Db::table($this->table)->getLastSql();
return
$result
;
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAddReportOrderList
(
$field
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.report_agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
"house_ids"
]))
{
$where_
[
"b.house_id"
]
=
array
(
"in"
,
$params
[
"house_ids"
]
);
}
$where_
[
"a.status"
]
=
0
;
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.id = b.f_id"
,
"left"
)
// ->join('g_houses d', 'b.house_id = d.id', 'left')
->
where
(
$where_
)
->
group
(
"a.id"
)
->
select
();
}
/**
* 获取报备和订单信息
*
* @param $field
* @param $where
* @param string $order
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getReportOrder
(
$field
,
$where
,
$order
=
'a.id desc'
)
{
return
$this
->
db
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_order b'
,
'b.f_id=a.id'
,
'left'
)
->
where
(
$where
)
->
order
(
$order
)
->
find
();
}
/**
* 根据order_id获得客方
*
* @param $report_id
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentByReportId
(
$report_id
)
{
$user_id
=
$this
->
db
->
field
(
'user_id'
)
->
where
(
'id'
,
$report_id
)
->
value
(
'user_id'
);
$user
=
new
Users
();
$agent_id
=
$user
->
where
(
'id'
,
$user_id
)
->
value
(
'agent_id'
);
$agent_data
=
$this
->
db
->
table
(
'a_agents'
)
->
field
(
'id,device_id'
)
->
where
(
'id'
,
$agent_id
)
->
find
();
return
$agent_data
;
}
public
function
getAgentByOrderId
(
$field
,
$params
)
{
...
...
@@ -941,170 +740,6 @@ class OfficeOReportModel extends Model
->
select
();
}
/**
* 获取经纪人新增带看数量
* @param $params
* @return int|string
*/
public
function
getAddFollowUpNumByAgentId
(
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"report_agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
return
Db
::
name
(
$this
->
table
)
->
where
(
$where_
)
->
count
();
}
/**
* 预约看铺待看列表
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getWaitToSeeList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
)
{
/*$data = $this
->field($field)
->alias("a")
->join("o_order b", "b.f_id = a.id", "left")
->join("o_march_in c", "c.report_id = b.id", "left")
->join("g_houses d", "d.id = b.house_id", "left")
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();*/
$start_index
=
(
$pageNo
-
1
)
*
$pageSize
;
if
(
isset
(
$params
[
"user_id"
]))
{
$user_id
=
$params
[
"user_id"
];
}
$sql
=
"select * from ((
SELECT
`a`.`id`,
a.user_id,
a.report_agent_id AS agents_id,
a.predict_see_time AS expect_time,
`b`.`house_id`,
a.create_time,
d.external_title AS house_title,
d.residue_num AS room_num_left,
d.is_show,
d.status,
d.external_image_id,
d.is_show_image
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `b`.`f_id` = `a`.`id`
LEFT JOIN `o_march_in` `c` ON `c`.`report_id` = `a`.`id`
LEFT JOIN `g_houses` `d` ON `d`.`id` = `b`.`house_id`
WHERE
`a`.`user_id` =
$user_id
AND (`c`.`id` IS NULL)
)
UNION
(
SELECT
a.id,
a.user_id,
a.agents_id,
a.expect_time,
a.house_id,
a.create_time,
b.external_title AS house_title,
b.residue_num AS room_num_left,
b.is_show,
b.status,
b.external_image_id,
b.is_show_image
FROM
u_appoint_watch_shop a
LEFT JOIN g_houses b ON a.house_id = b.id
WHERE
a.user_id =
$user_id
and a.agents_id IS NULL
and a.status in (0,1)
) ) as aaa order by aaa.create_time desc limit
$start_index
,
$pageSize
"
;
//echo $sql;
$data
=
$this
->
db
->
query
(
$sql
);
return
$data
;
}
/**
* 预约看铺列表 已看列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHaveToSeeList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"b.f_id = a.id"
,
"left"
)
->
join
(
"o_march_in c"
,
"c.report_id = a.id"
,
"right"
)
->
join
(
"g_houses d"
,
"d.id = b.house_id"
,
"left"
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
//echo $this->getLastSql();
return
$data
;
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getMaxReportAgent
(
$field
,
$where
)
{
return
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'o_order b'
,
'a.id = b.f_id'
,
'left'
)
->
where
(
$where
)
->
group
(
'a.report_agent_id '
)
->
find
();
}
/**
* @param $field
* @param $where
* @return mixed
*/
public
function
getFieldValue
(
$field
,
$where
)
{
return
$this
->
db
->
where
(
$where
)
->
value
(
$field
);
}
public
function
selectReportByIdTime
(
$filed
=
"id"
,
$params
)
{
$params
[
"status"
]
=
0
;
return
$this
->
db
->
field
(
$filed
)
->
where
(
$params
)
->
select
();
}
}
...
...
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