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
93a1ccf7
Commit
93a1ccf7
authored
Apr 01, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
5322c86b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
Statement.php
application/api_broker/controller/Statement.php
+3
-3
StatementService.php
application/api_broker/service/StatementService.php
+10
-6
No files found.
application/api_broker/controller/Statement.php
View file @
93a1ccf7
...
@@ -31,11 +31,11 @@ class Statement extends Basic
...
@@ -31,11 +31,11 @@ class Statement extends Basic
{
{
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/*
$params = array(
$params
=
array
(
"agent_id" =>
3
,
"agent_id"
=>
715
,
"time_start"
=>
date
(
"Y-m-d"
,
time
()),
"time_start"
=>
date
(
"Y-m-d"
,
time
()),
"time_end"
=>
date
(
"Y-m-d"
,
time
())
.
" 23:59:59"
,
"time_end"
=>
date
(
"Y-m-d"
,
time
())
.
" 23:59:59"
,
);
*/
);
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"time_start"
])
||
!
isset
(
$params
[
"time_end"
]))
{
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"time_start"
])
||
!
isset
(
$params
[
"time_end"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
...
...
application/api_broker/service/StatementService.php
View file @
93a1ccf7
...
@@ -151,19 +151,23 @@ class StatementService
...
@@ -151,19 +151,23 @@ class StatementService
$conditions_
[
"district_id"
]
=
$district_id
;
//本周人数
$conditions_
[
"district_id"
]
=
$district_id
;
//本周人数
$results
=
$this
->
agentModel
->
countAgentNum
(
$conditions_
);
$results
=
$this
->
agentModel
->
countAgentNum
(
$conditions_
);
dump
(
$results
);
//
dump($results);
$last_week_total
=
0
;
$last_week_total
=
0
;
foreach
(
$result
as
$key
=>
$value
){
foreach
(
$result
s
as
$key
=>
$value
){
$last_week_total
+=
$value
[
"agent_num"
];
$last_week_total
+=
$value
[
"agent_num"
];
$paramArr
[
"store_id"
]
=
$value
[
"store_id"
];
$paramArr
[
"store_id"
]
=
$value
[
"store_id"
];
$paramArr
[
"level"
]
=
array
(
"in"
,[
20
,
40
]);
$paramArr
[
"level"
]
=
array
(
"in"
,[
20
,
40
]);
$agentsResult
=
$this
->
agentModel
->
getAgentsByStoreId
(
$paramArr
);
$agentsResult
=
$this
->
agentModel
->
getAgentsByStoreId
(
$paramArr
);
$result
[
$key
][
"name"
]
=
count
(
$agentsResult
)
>
0
?
$agentsResult
[
0
][
"name"
]
:
null
;
$results
[
$key
][
"name"
]
=
count
(
$agentsResult
)
>
0
?
$agentsResult
[
0
][
"name"
]
:
null
;
$result
[
$key
][
"last_week_num"
]
=
$value
[
"agent_num"
];
foreach
(
$result
as
$i
=>
$item
){
$result
[
$key
][
"agent_num"
]
=
$results
[
$key
][
"agent_num"
];
if
(
$value
[
"store_id"
]
==
$item
[
"store_id"
]){
$results
[
$key
][
"last_week_num"
]
=
$item
[
"agent_num"
];
}
}
}
}
$district_list
[
"last_week_total"
]
=
$last_week_total
;
$district_list
[
"last_week_total"
]
=
$last_week_total
;
$district_list
[
"district_list"
]
=
$result
;
$district_list
[
"district_list"
]
=
$result
s
;
return
$district_list
;
return
$district_list
;
}
}
...
...
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