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
6c4f82c6
Commit
6c4f82c6
authored
Mar 23, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩模块
parent
a24631ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
17 deletions
+101
-17
Performance.php
application/api_broker/controller/Performance.php
+31
-3
PerformanceService.php
application/api_broker/service/PerformanceService.php
+69
-13
GHousesToAgents.php
application/model/GHousesToAgents.php
+1
-1
No files found.
application/api_broker/controller/Performance.php
View file @
6c4f82c6
...
...
@@ -57,16 +57,20 @@ class Performance extends Basic
}
/**
* 个人业绩
* @return \think\Response
*/
public
function
agentPerformanceBySearch
()
{
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
"agent_id" => 1,
"start_time" => "2018-03-23",
"end_time" => "2018-03-23",
"is_case" => 2,//1经纪人 2案场
"house_id"
=>
22
);
"house_id" =>
0
);
*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"start_time"
])
||
!
isset
(
$params
[
"end_time"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
@@ -79,4 +83,28 @@ class Performance extends Basic
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
public
function
orderNoLIst
(){
$params
=
$this
->
params
;
$params
=
array
(
"agent_id"
=>
1
,
"start_time"
=>
"2018-03-23"
,
"end_time"
=>
"2018-03-23"
,
"is_case"
=>
2
,
//1经纪人 2案场
"house_id"
=>
0
,
"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"
,
"请求参数错误"
);
}
$house_id
=
0
;
if
(
isset
(
$params
[
"house_id"
]))
{
$house_id
=
$params
[
"house_id"
];
}
$result
=
$this
->
service_
->
orderList
(
$params
[
"agent_id"
],
$params
[
"start_time"
],
$params
[
"end_time"
],
$params
[
"is_case"
],
$house_id
,
$params
[
"type"
]);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
application/api_broker/service/PerformanceService.php
View file @
6c4f82c6
...
...
@@ -136,14 +136,22 @@ class PerformanceService
}
public
function
personagePerformance
(
$agent_id
,
$start_time
,
$end_time
,
$is_case
,
$house_id
)
/**
* @param $agent_id
* @param $start_time
* @param $end_time
* @param $is_case
* @param $house_id
* @return array|mixed|null
*/
public
function
personagePerformance
(
$agent_id
,
$start_time
,
$end_time
,
$is_case
,
$house_id
)
{
$field
=
"agent_id,sum(look_at_num) as look_at_num,sum(march_in_num) as march_in_num , sum(paylog) as paylog ,
sum(bargain_sum) as bargain_sum"
;
$result
=
[];
switch
(
$is_case
){
switch
(
$is_case
)
{
case
1
:
$now_date
=
date
(
"Y-m-d"
,
time
());
if
(
$start_time
==
$now_date
&&
$end_time
==
$now_date
)
{
...
...
@@ -161,22 +169,70 @@ class PerformanceService
}
break
;
case
2
:
//案场
if
(
$house_id
>
0
){
// 如果有传楼盘id证明是筛选
$condition
[
"house_ids"
]
=
$house_id
;
}
else
{
$vService
=
new
VerifyService
();
$house_id_arr
=
$vService
->
getCaseHouseIdByAgentId
(
$agent_id
);
$ids
=
""
;
foreach
(
$house_id_arr
as
$item
){
$ids
.=
$item
[
"houses_id"
]
.
","
;
$house_id_arr
=
[];
if
(
$house_id
>
0
)
{
// 如果有传楼盘id证明是筛选
$condition
[
"house_ids"
]
=
$house_id
;
}
else
{
$vService
=
new
VerifyService
();
$house_id_arr
=
$vService
->
getCaseHouseIdByAgentId
(
$agent_id
);
$ids
=
""
;
foreach
(
$house_id_arr
as
$item
)
{
$ids
.=
$item
[
"houses_id"
]
.
","
;
}
$ids
=
rtrim
(
$ids
,
","
);
$condition
[
"house_ids"
]
=
$ids
;
}
$condition
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$result
=
$this
->
nowTimeSum
(
$condition
);
if
(
count
(
$result
)
>
0
&&
$house_id
==
0
)
{
$result
[
"house_arr"
]
=
$house_id_arr
;
}
break
;
}
if
(
count
(
$result
)
>
0
)
{
return
$result
;
}
else
{
return
null
;
}
}
public
function
orderList
(
$agent_id
,
$start_time
,
$end_time
,
$is_case
,
$house_id
,
$type
)
{
$result
=
[];
switch
(
$is_case
)
{
case
1
:
$params
[
"agent_id"
]
=
$agent_id
;
$params
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$result
=
$this
->
nowTimeSum
(
$params
);
break
;
case
2
:
//案场
$house_id_arr
=
[];
if
(
$house_id
>
0
)
{
// 如果有传楼盘id证明是筛选
$condition
[
"house_ids"
]
=
$house_id
;
}
else
{
$vService
=
new
VerifyService
();
$house_id_arr
=
$vService
->
getCaseHouseIdByAgentId
(
$agent_id
);
$ids
=
""
;
foreach
(
$house_id_arr
as
$item
)
{
$ids
.=
$item
[
"houses_id"
]
.
","
;
}
$ids
=
rtrim
(
$ids
,
","
);
$condition
[
"house_ids"
]
=
$ids
;
$ids
=
rtrim
(
$ids
,
","
);
$condition
[
"house_ids"
]
=
$ids
;
}
$condition
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$result
=
$this
->
nowTimeSum
(
$condition
);
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
&&
$house_id
==
0
)
{
$result
[
"house_arr"
]
=
$house_id_arr
;
}
break
;
...
...
application/model/GHousesToAgents.php
View file @
6c4f82c6
...
...
@@ -152,7 +152,7 @@ class GHousesToAgents extends BaseModel
->
where
(
$params
)
->
select
();
echo
Db
::
name
(
$this
->
table
)
->
getLastSql
();
//
echo Db::name($this->table)->getLastSql();
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