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
f05e8411
Commit
f05e8411
authored
Mar 12, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日报周报
parent
b66b2dd5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
9 deletions
+27
-9
Statement.php
application/api_broker/controller/Statement.php
+3
-4
StatementService.php
application/api_broker/service/StatementService.php
+13
-4
AAgents.php
application/model/AAgents.php
+4
-1
route.php
application/route.php
+7
-0
No files found.
application/api_broker/controller/Statement.php
View file @
f05e8411
...
...
@@ -28,13 +28,12 @@ class Statement extends Basic
public
function
dayStatement
()
{
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
"agent_id" => 1,
//"type" => 1, // 1.日报 2.周报
"time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()) . " 23:59:59",
);
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"t
ype
"
]))
{
);
*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"t
ime_start"
])
||
!
isset
(
$params
[
"time_end
"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
try
{
...
...
application/api_broker/service/StatementService.php
View file @
f05e8411
...
...
@@ -19,6 +19,10 @@ class StatementService {
private
$userModel
;
private
$followUpModel
;
const
USER_LEVEL_FIST
=
0
;
//经纪人
const
USER_LEVEL_SECOND
=
1
;
//店长
const
USER_LEVEL_THIRD
=
2
;
//总监
function
__construct
()
{
$this
->
agentModel
=
new
AAgents
();
...
...
@@ -46,12 +50,12 @@ class StatementService {
return
null
;
}
$user_type
=
0
;
//经纪人权限,0经纪人 1店长 2总监
$user_type
=
self
::
USER_LEVEL_FIST
;
//经纪人权限,0经纪人 1店长 2总监
if
(
$agent_result
[
0
][
"level"
]
==
20
){
$user_type
=
1
;
$user_type
=
self
::
USER_LEVEL_SECOND
;
}
elseif
(
$agent_result
[
0
][
"level"
]
==
30
||
$agent_result
[
0
][
"level"
]
==
40
){
$user_type
=
2
;
$user_type
=
self
::
USER_LEVEL_THIRD
;
}
$store_id
=
$agent_result
[
0
][
"store_id"
];
$district_id
=
$agent_result
[
0
][
"district_id"
];
...
...
@@ -63,6 +67,7 @@ class StatementService {
}
private
function
selectStatement
(
$conditions
,
$user_type
,
$store_id
,
$district_id
){
$result
=
$params
=
[];
switch
(
$user_type
){
case
0
:
...
...
@@ -79,9 +84,12 @@ class StatementService {
break
;
}
$agent_total
=
1
;
//进到这里的经纪人肯定都存在所以默认此经纪人数量为1
if
(
!
empty
(
$params
)){
$agentsArr
=
$this
->
agentModel
->
getAgentsByStoreId
(
$params
);
if
(
count
(
$agentsArr
)
>
0
){
$agent_total
=
count
(
$agentsArr
);
if
(
$agent_total
>
0
){
$agentIds
=
""
;
foreach
(
$agentsArr
as
$key
=>
$value
){
$agentIds
.=
$value
[
"id"
]
.
","
;
...
...
@@ -91,6 +99,7 @@ class StatementService {
}
}
$result
[
"agent_total"
]
=
$agent_total
;
$result
[
"house_num"
]
=
$this
->
houseModel
->
getAddHouseNumByAgentId
(
$conditions
);
$result
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentId
(
$conditions
);
$result
[
"follow_up_num"
]
=
$this
->
followUpModel
->
getAddFollowUpNumByAgentId
(
$conditions
);
...
...
application/model/AAgents.php
View file @
f05e8411
...
...
@@ -335,9 +335,11 @@ class AAgents extends BaseModel
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAgentsByStoreId
(
$params
){
return
Db
::
table
(
$this
->
table
)
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
"id"
)
->
where
(
$params
)
->
select
();
echo
Db
::
table
(
$this
->
table
)
->
getLastSql
();
return
$result
;
}
}
\ No newline at end of file
application/route.php
View file @
f05e8411
...
...
@@ -298,6 +298,12 @@ Route::group('broker', [
'getAgentsByPhone'
=>
[
'api_broker/broker/getAgentsByPhone'
,
[
'method'
=>
'get'
]
],
'agentsPhone'
=>
[
'api_broker/CellPhone/agentsPhone'
,
[
'method'
=>
'get|post'
]
],
//获取经纪人拨打界面手机号
'dayStatement'
=>
[
'api_broker/Statement/dayStatement'
,
[
'method'
=>
'get|post'
]
],
]);
//Route::miss('api/index/miss');//处理错误的url
\ 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