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
595699d8
Commit
595699d8
authored
Jul 08, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f0df18d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
9 deletions
+33
-9
Performance.php
application/index/controller/Performance.php
+5
-4
PerformanceService.php
application/index/service/PerformanceService.php
+26
-5
UserLogService.php
application/index/service/UserLogService.php
+2
-0
No files found.
application/index/controller/Performance.php
View file @
595699d8
...
...
@@ -60,11 +60,12 @@ class Performance extends Basic
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$params
);
//dump($list);
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"official_receipts_total"
]
=
$list
[
'official_receipts_total'
];
$result
[
"start_time"
]
=
$start_day
;
$result
[
"end_time"
]
=
$end_day
;
$result
[
"end_time"
]
=
$end_day
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
return
$this
->
response
(
"200"
,
"request null"
);
...
...
application/index/service/PerformanceService.php
View file @
595699d8
...
...
@@ -51,14 +51,15 @@ class PerformanceService
/**
*
@param $agent_id
*
业绩排行
* @param $type
* @param $yesterday
* @param $end_day
* @param $pageNo
* @param $pageSize
* @param $father_id
* @param $params
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
totalAgent
(
$type
,
$yesterday
,
$end_day
,
$pageNo
,
$pageSize
,
$father_id
,
$params
)
{
...
...
@@ -124,6 +125,9 @@ class PerformanceService
}
/*计算总业绩 end*/
//计算总实收
$official_receipts_total
=
$this
->
getOfficialReceiPtsTotal
(
$where_
,
$type
);
$arr
=
[];
$num
=
(
$pageNo
-
1
)
*
$pageSize
;
...
...
@@ -180,7 +184,24 @@ class PerformanceService
$ranking_num
=
$this
->
getRanking
(
$type
,
$yesterday
,
$end_day
,
$pageNo
,
$pageSize
,
$params
,
$agent_id
);
$result
[
0
][
'index_'
]
=
$ranking_num
;
}
return
[
'list'
=>
$result
,
'total'
=>
$total_result
,
'performance_total'
=>
$sum_result_num
];
return
[
'list'
=>
$result
,
'total'
=>
$total_result
,
'performance_total'
=>
$sum_result_num
,
'official_receipts_total'
=>
$official_receipts_total
];
}
/**
* 计算总的实收
* @param $where_
* @param $type
* @return int
*/
public
function
getOfficialReceiPtsTotal
(
$where_
,
$type
){
$field
=
"sum(official_receipts) as official_receipts_total"
;
$sum_result
=
$this
->
totalModel
->
getTotalByAgentIdForPcPerformanceSum
(
$field
,
$where_
,
$type
);
$total
=
0
;
foreach
(
$sum_result
as
$k1
=>
$v1
)
{
$total
+=
$v1
[
'official_receipts_total'
];
}
return
$total
;
}
/**
...
...
application/index/service/UserLogService.php
View file @
595699d8
...
...
@@ -316,6 +316,8 @@ class UserLogService
$result
[
'first_login_time'
]
=
$user_result
[
'first_login_time'
];
// 客户来源
$result
[
'source_intro'
]
=
$user_result
[
'source_intro'
];
$result
[
'concrete_industry'
]
=
$user_result
[
'concrete_industry'
];
$result
[
'weixin_nick'
]
=
$user_result
[
'weixin_nick'
];
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