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
9e65825a
Commit
9e65825a
authored
Oct 15, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
咨询经纪人修改
parent
bfeb8e36
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
Broker.php
application/api/controller/Broker.php
+6
-6
OMarchInModel.php
application/model/OMarchInModel.php
+17
-0
No files found.
application/api/controller/Broker.php
View file @
9e65825a
...
...
@@ -8,7 +8,7 @@ use app\model\AAgents;
use
app\model\Evaluate
;
use
app\model\EvaluateSign
;
use
app\model\OBargainModel
;
use
app\model\O
Report
Model
;
use
app\model\O
MarchIn
Model
;
/**
* Description of Agents
...
...
@@ -52,14 +52,14 @@ class Broker extends Basic
}
//查找30天带看最多的人
$m_
report
=
new
OReport
Model
();
$report_fields
=
'COUNT( a.re
port_agent_id ) AS num,a.report_agent
_id '
;
$m_
march
=
new
OMarchIn
Model
();
$report_fields
=
'COUNT( a.re
ception_id ) AS num,a.reception
_id '
;
$report_where
[
'b.house_id'
]
=
$params
[
'house_id'
];
$report_where
[
'a.create_time'
]
=
[
'between'
,
[
date
(
'Y-m-d'
,
strtotime
(
"-30 day"
))
.
' 00:00:00'
,
date
(
'Y-m-d'
)
.
' 23:59:59'
]];
$re
port_agent_id
=
$m_report
->
getMaxReport
Agent
(
$report_fields
,
$report_where
);
$re
ception_id
=
$m_march
->
getMaxMarchIn
Agent
(
$report_fields
,
$report_where
);
if
(
!
empty
(
$re
port_agent_id
[
'report_agent
_id'
]))
{
$report_agent
=
$agents
->
getUser
(
1
,
1
,
''
,
$fields
,
[
'a.id'
=>
$re
port_agent_id
[
'report_agent
_id'
],
'a.status'
=>
0
,
'c.is_del'
=>
0
]);
if
(
!
empty
(
$re
ception_id
[
'reception
_id'
]))
{
$report_agent
=
$agents
->
getUser
(
1
,
1
,
''
,
$fields
,
[
'a.id'
=>
$re
ception_id
[
'reception
_id'
],
'a.status'
=>
0
,
'c.is_del'
=>
0
]);
}
$where
[
'c.houses_id'
]
=
$params
[
'house_id'
];
...
...
application/model/OMarchInModel.php
View file @
9e65825a
...
...
@@ -397,4 +397,20 @@ class OMarchInModel extends Model
return
$return
;
}
/**
* @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
getMaxMarchInAgent
(
$field
,
$where
)
{
return
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'o_order b'
,
'a.id = b.f_id'
,
'left'
)
->
where
(
$where
)
->
group
(
'a.reception_id '
)
->
find
();
}
}
\ No newline at end of file
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