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
c61697fb
Commit
c61697fb
authored
Jun 01, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩排行
parent
b42f3fac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
8 deletions
+21
-8
Performance.php
application/api_broker/controller/Performance.php
+4
-4
PerformanceService.php
application/api_broker/service/PerformanceService.php
+7
-3
AAgents.php
application/model/AAgents.php
+9
-0
TAgentTotalModel.php
application/model/TAgentTotalModel.php
+1
-1
No files found.
application/api_broker/controller/Performance.php
View file @
c61697fb
...
@@ -37,9 +37,9 @@ class Performance extends Basic
...
@@ -37,9 +37,9 @@ class Performance extends Basic
{
{
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/*
$params = array(
/*
$params = array(
"agent_id" =>
10013
,
"agent_id" =>
80
,
"type" =>
1
, //1表示个人业绩排行 2门店 3区域
"type" =>
3
, //1表示个人业绩排行 2门店 3区域
"end_day" => "",
"end_day" => "",
"start_day" =>""
"start_day" =>""
);*/
);*/
...
@@ -47,7 +47,7 @@ class Performance extends Basic
...
@@ -47,7 +47,7 @@ class Performance extends Basic
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
//默认排序一周
//默认排序一周
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
(
));
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"agent_id"
],
$params
[
"type"
],
$end_day
,
$start_day
);
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"agent_id"
],
$params
[
"type"
],
$end_day
,
$start_day
);
//dump($list);
//dump($list);
...
...
application/api_broker/service/PerformanceService.php
View file @
c61697fb
...
@@ -91,9 +91,11 @@ class PerformanceService
...
@@ -91,9 +91,11 @@ class PerformanceService
if
(
$value
[
"store_id"
]
==
$agent_info
[
"store_id"
]
||
$key
<
5
)
{
if
(
$value
[
"store_id"
]
==
$agent_info
[
"store_id"
]
||
$key
<
5
)
{
$value
[
"index_"
]
=
$key
+
1
;
$value
[
"index_"
]
=
$key
+
1
;
$value
[
"is_my"
]
=
$agent_info
[
"store_id"
];
$value
[
"is_my"
]
=
$agent_info
[
"store_id"
];
$info
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$field
,
[
"agent_id"
=>
$value
[
"agent_id"
]
]);
$info
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$field
,
[
"agent_id"
=>
$value
[
"agent_id"
]
,
""
]);
$store_name
=
$this
->
agentModel
->
getStoreOrDistrict
([
"store_id"
=>
$value
[
"store_id"
],
"level"
=>
20
]);
$name
=
count
(
$store_name
)
>
0
?
$store_name
[
0
][
"name"
]
:
"---"
;
if
(
count
(
$info
)
>
0
)
{
if
(
count
(
$info
)
>
0
)
{
$value
[
"name"
]
=
$
info
[
0
][
"name"
]
;
$value
[
"name"
]
=
$
name
;
$value
[
"img"
]
=
AGENTHEADERIMGURL
.
$info
[
0
][
"img"
];
$value
[
"img"
]
=
AGENTHEADERIMGURL
.
$info
[
0
][
"img"
];
$value
[
"store_name"
]
=
$info
[
0
][
"store_name"
];
$value
[
"store_name"
]
=
$info
[
0
][
"store_name"
];
$value
[
"district_name"
]
=
$info
[
0
][
"district_name"
];
$value
[
"district_name"
]
=
$info
[
0
][
"district_name"
];
...
@@ -105,8 +107,10 @@ class PerformanceService
...
@@ -105,8 +107,10 @@ class PerformanceService
$value
[
"index_"
]
=
$key
+
1
;
$value
[
"index_"
]
=
$key
+
1
;
$value
[
"is_my"
]
=
$agent_info
[
"district_id"
];
$value
[
"is_my"
]
=
$agent_info
[
"district_id"
];
$info
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$field
,
[
"agent_id"
=>
$value
[
"agent_id"
]
]);
$info
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$field
,
[
"agent_id"
=>
$value
[
"agent_id"
]
]);
$district_name
=
$this
->
agentModel
->
getStoreOrDistrict
([
"store_id"
=>
$value
[
"store_id"
],
"level"
=>
[
"in"
,
"30,40"
]]);
$name
=
count
(
$district_name
)
>
0
?
$district_name
[
0
][
"name"
]
:
"---"
;
if
(
count
(
$info
)
>
0
)
{
if
(
count
(
$info
)
>
0
)
{
$value
[
"name"
]
=
$
info
[
0
][
"name"
]
;
$value
[
"name"
]
=
$
name
;
$value
[
"img"
]
=
AGENTHEADERIMGURL
.
$info
[
0
][
"img"
];
$value
[
"img"
]
=
AGENTHEADERIMGURL
.
$info
[
0
][
"img"
];
$value
[
"store_name"
]
=
$info
[
0
][
"store_name"
];
$value
[
"store_name"
]
=
$info
[
0
][
"store_name"
];
$value
[
"district_name"
]
=
$info
[
0
][
"district_name"
];
$value
[
"district_name"
]
=
$info
[
0
][
"district_name"
];
...
...
application/model/AAgents.php
View file @
c61697fb
...
@@ -444,6 +444,15 @@ class AAgents extends BaseModel
...
@@ -444,6 +444,15 @@ class AAgents extends BaseModel
}
}
public
function
getStoreOrDistrict
(
$params
){
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
"id,name"
)
->
where
(
$params
)
->
select
();
//echo Db::table($this->table)->getLastSql();
return
$result
;
}
public
function
searchAgentsByKeyword
(
$field
,
$params
)
public
function
searchAgentsByKeyword
(
$field
,
$params
)
{
{
...
...
application/model/TAgentTotalModel.php
View file @
c61697fb
...
@@ -87,7 +87,7 @@ class TAgentTotalModel extends Model
...
@@ -87,7 +87,7 @@ class TAgentTotalModel extends Model
->
group
(
$group_
)
->
group
(
$group_
)
->
order
(
$order
)
->
order
(
$order
)
->
select
();
->
select
();
//
echo $this->db_->getLastSql();
//
echo $this->db_->getLastSql();
return
$result
;
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