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
bd0b3a05
Commit
bd0b3a05
authored
Mar 25, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩模块
parent
9addc727
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
20 deletions
+45
-20
Performance.php
application/api_broker/controller/Performance.php
+12
-8
PerformanceService.php
application/api_broker/service/PerformanceService.php
+17
-11
AppChat.php
application/chat/controller/AppChat.php
+1
-0
AAgents.php
application/model/AAgents.php
+11
-1
TAgentTotalModel.php
application/model/TAgentTotalModel.php
+3
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Performance.php
View file @
bd0b3a05
...
...
@@ -99,11 +99,11 @@ class Performance extends Basic
public
function
storePerformanceBySearch
()
{
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
"agent_id" => 1,
"start_time"
=>
"2018-03-
23
"
,
"start_time" => "2018-03-
10
",
"end_time" => "2018-03-23",
);
);
*/
try
{
$result
=
$this
->
service_
->
storePerformance
(
$params
[
"agent_id"
],
$params
[
"start_time"
],
$params
[
"end_time"
]);
...
...
@@ -120,14 +120,14 @@ class Performance extends Basic
public
function
orderNoList
()
{
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
"agent_id" => 1,
"start_time"
=>
"2018-03-
2
3"
,
"end_time"
=>
"2018-03-2
3
"
,
"start_time" => "2018-03-
1
3",
"end_time" => "2018-03-2
6
",
"is_case" => 2,//1经纪人 2案场
"house_id" => 0,
"type"
=>
2
// 1带看 2进场 3收款 4成交报告
);
"type" =>
1
// 1带看 2进场 3收款 4成交报告
);
*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"start_time"
])
||
!
isset
(
$params
[
"end_time"
])
||
!
isset
(
$params
[
"type"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
@@ -146,6 +146,10 @@ class Performance extends Basic
}
}
/**
* 门店或者经纪人业绩排行
* @return \think\Response
*/
public
function
storeOrAgentSort
(){
$params
=
$this
->
params
;
$params
=
array
(
...
...
application/api_broker/service/PerformanceService.php
View file @
bd0b3a05
...
...
@@ -343,7 +343,6 @@ class PerformanceService
{
$result
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id,store_id,district_id,level"
,
[
"id"
=>
$agent_id
]);
dump
(
$result
);
if
(
count
(
$result
)
<=
0
)
{
return
null
;
}
...
...
@@ -351,12 +350,7 @@ class PerformanceService
$field
=
"store_id,agent_id,sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num,sum(march_in_num) as march_in_num,
sum(performance) as performance,sum(official_receipts) as official_receipts"
;
/* $where_["agent_id"] = $agent_id;
$where_['total_time'] = array( 'between', array( $start_time, $end_time ) );
$list = $this->totalModel->personagePerformance($field, $where_);*/
$type
=
0
;
if
(
$result
[
0
][
"level"
]
==
20
)
{
$type
=
1
;
$params
[
"store_id"
]
=
$result
[
0
][
"store_id"
];
...
...
@@ -367,11 +361,23 @@ class PerformanceService
$params
[
'total_time'
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
$field
=
"agent_id,store_id,district_id,sum(performance) as performance_total"
;
$order
=
"total_time desc"
;
$result
=
$this
->
totalModel
->
getTotalByAgentId
(
$field
,
$params
,
$type
,
$order
);
dump
(
$result
);
$order
=
"total_time desc"
;
$list
=
$this
->
totalModel
->
getTotalByAgentId
(
$field
,
$params
,
$type
,
$order
);
if
(
count
(
$list
)
>
0
)
{
foreach
(
$list
as
$key
=>
$item
)
{
$fields
=
"a.name,b.store_name"
;
$where_
[
"a.store_id"
]
=
$item
[
"store_id"
];
$info
=
$this
->
agentModel
->
getStoreOrAgentInfo
(
$fields
,
$where_
);
if
(
count
(
$info
)
>
0
)
{
$list
[
$key
][
"store_name"
]
=
$info
[
0
][
"store_name"
];
$list
[
$key
][
"name"
]
=
$info
[
0
][
"name"
];
}
else
{
$list
[
$key
][
"store_name"
]
=
""
;
$list
[
$key
][
"name"
]
=
""
;
}
}
}
return
$list
;
}
private
function
sumDistrictPerformance
(
$params
)
...
...
application/chat/controller/AppChat.php
View file @
bd0b3a05
...
...
@@ -205,6 +205,7 @@ class AppChat extends Basic
*/
public
function
uploadImg
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$file
=
request
()
->
file
(
'image'
);
$data
=
[];
if
(
$file
)
{
...
...
application/model/AAgents.php
View file @
bd0b3a05
...
...
@@ -454,7 +454,17 @@ class AAgents extends BaseModel
->
find
();
}
/**
public
function
getStoreOrAgentInfo
(
$field
,
$params
){
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_store b"
,
"a.store_id = b.id"
,
"left"
)
->
where
(
$params
)
->
where
(
'a.level'
,[
'='
,
20
],[
'='
,
40
],
'or'
)
->
select
();
return
$result
;
}
/**
* 根据id获取经纪人信息
*
* @param $field
...
...
application/model/TAgentTotalModel.php
View file @
bd0b3a05
...
...
@@ -92,6 +92,9 @@ class TAgentTotalModel extends Model
}
/**
* 统计时间端经纪人业绩
* @param $field
...
...
application/route.php
View file @
bd0b3a05
...
...
@@ -363,6 +363,7 @@ Route::group('broker', [
'selectPerformanceByTime'
=>
[
'api_broker/Performance/selectPerformanceByTime'
,
[
'method'
=>
'get'
]],
'agentPerformanceBySearch'
=>
[
'api_broker/Performance/agentPerformanceBySearch'
,
[
'method'
=>
'get'
]],
'orderNoList'
=>
[
'api_broker/Performance/orderNoList'
,
[
'method'
=>
'get'
]],
'storePerformanceBySearch'
=>
[
'api_broker/Performance/storePerformanceBySearch'
,
[
'method'
=>
'get'
]],
'storeOrAgentSort'
=>
[
'api_broker/Performance/storeOrAgentSort'
,
[
'method'
=>
'get'
]],
'weekWorkImg'
=>
[
'api_broker/Statement/weekWorkImg'
,
[
'method'
=>
'post'
]],
//生成周报和日报图片
...
...
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