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
655e3cee
Commit
655e3cee
authored
Jan 24, 2019
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cache
parent
620be3c0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
0 deletions
+121
-0
RankingList.php
application/api_broker/controller/RankingList.php
+116
-0
route.php
application/route.php
+5
-0
No files found.
application/api_broker/controller/RankingList.php
0 → 100644
View file @
655e3cee
<?php
namespace
app\app_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\index\service\RankingListService
;
use
app\model\AAgents
;
use
think\Request
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/11/12
* Time : 2:04 PM
* Intro: pk榜
*/
class
RankingList
extends
Basic
{
private
$service_
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
service_
=
new
RankingListService
();
}
/**
* 查询分区业绩pk by 个人
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getRandKingListByAgentId
(){
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params["agent_id"] = 1;
$this->siteId = 10001;*/
if
(
!
isset
(
$params
[
"agent_id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$agentModel
=
new
AAgents
();
$agent_info
=
$agentModel
->
getAgentInfo
(
"id,position"
,
$params
[
"agent_id"
]);
if
(
$agent_info
[
"position"
]
==
5
){
return
$this
->
response
(
"101"
,
"该经纪人没有分配职称"
);
}
$result
=
$this
->
service_
->
RankingList
(
$agent_info
[
"position"
],
$this
->
siteId
);
$agent_id
=
$params
[
"agent_id"
];
$data
=
[];
foreach
(
$result
as
$key
=>
$value
){
$is_exits
=
false
;
foreach
(
$value
as
$item
){
if
(
$item
[
"id"
]
==
$agent_id
){
$is_exits
=
true
;
}
}
if
(
!
$is_exits
){
unset
(
$result
[
$key
]);
}
else
{
$data
[
"list"
]
=
$value
;
$data
[
"grade"
]
=
$key
;
}
}
$data
[
"position"
]
=
$agent_info
[
"position"
];
if
(
count
(
$result
)
>
0
){
return
$this
->
response
(
"200"
,
"success"
,
$data
);
}
return
$this
->
response
(
"200"
,
"null"
);
}
/**
* 首页团队排名
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getStoreRandKingListByAgentId
(){
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params["agent_id"] = 1;
$this->siteId = 10001;*/
if
(
!
isset
(
$params
[
"agent_id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$agentModel
=
new
AAgents
();
$agent_info
=
$agentModel
->
getAgentInfo
(
"id,position,store_id"
,
$params
[
"agent_id"
]);
if
(
count
(
$agent_info
)
<=
0
){
return
$this
->
response
(
"101"
,
"该经纪人不存在"
);
}
$result
=
$this
->
service_
->
StoreRankingList
(
$this
->
siteId
);
$store_id
=
$agent_info
[
"store_id"
];
$data
=
[];
foreach
(
$result
as
$key
=>
$value
){
$is_exits
=
false
;
foreach
(
$value
as
$item
){
if
(
$item
[
"id"
]
==
$store_id
){
$is_exits
=
true
;
}
}
if
(
!
$is_exits
){
unset
(
$result
[
$key
]);
}
else
{
$data
[
"list"
]
=
$value
;
$data
[
"grade"
]
=
$key
;
}
}
if
(
count
(
$result
)
>
0
){
return
$this
->
response
(
"200"
,
"success"
,
$data
);
}
return
$this
->
response
(
"200"
,
"null"
);
}
}
\ No newline at end of file
application/route.php
View file @
655e3cee
...
@@ -784,6 +784,10 @@ Route::group('broker', [
...
@@ -784,6 +784,10 @@ Route::group('broker', [
'commitCheck'
=>
[
'api_broker/DailyPaper/commitCheck'
,
[
'method'
=>
'get|post'
]],
'commitCheck'
=>
[
'api_broker/DailyPaper/commitCheck'
,
[
'method'
=>
'get|post'
]],
'getPayLogImg'
=>
[
'api_broker/DailyPaper/getPayLogImg'
,
[
'method'
=>
'get|post'
]],
'getPayLogImg'
=>
[
'api_broker/DailyPaper/getPayLogImg'
,
[
'method'
=>
'get|post'
]],
'getRandKingListByAgentId'
=>
[
'api_broker/RankingList/getRandKingListByAgentId'
,
[
'method'
=>
'GET|POST'
]],
'getStoreRandKingListByAgentId'
=>
[
'api_broker/RankingList/getStoreRandKingListByAgentId'
,
[
'method'
=>
'GET|POST'
]],
]);
]);
//Route::miss('api/index/miss');//处理错误的url
//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