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
1345d92a
Commit
1345d92a
authored
Aug 08, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
28082f5b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
28 deletions
+72
-28
PerformanceStatistics.php
application/api_broker/controller/PerformanceStatistics.php
+57
-0
PerformanceService.php
application/api_broker/service/PerformanceService.php
+9
-9
PerformanceUtilService.php
application/api_broker/service/PerformanceUtilService.php
+5
-18
OBargainModel.php
application/model/OBargainModel.php
+1
-1
No files found.
application/api_broker/controller/PerformanceStatistics.php
0 → 100644
View file @
1345d92a
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\PerformanceUtilService
;
use
think\Exception
;
use
think\Request
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/8/8
* Time : 14:02
* Intro:
*/
class
PerformanceStatistics
extends
Basic
{
private
$service_
;
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
service_
=
new
PerformanceUtilService
();
}
/**
* 个人业绩
* @return \think\Response
*/
public
function
agentPerformanceBySearch
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"agent_id" => 9,
"start_time" => "2018-06-20",
"end_time" => "2018-06-20",
"is_case" => 1,//1经纪人 2案场
"house_id" => 0
);*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"start_time"
])
||
!
isset
(
$params
[
"end_time"
])
||
!
isset
(
$params
[
"is_case"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$house_id
=
0
;
if
(
isset
(
$params
[
"house_id"
]))
{
$house_id
=
$params
[
"house_id"
];
}
try
{
$result
=
$this
->
service_
->
personagePerformance
(
$params
[
"agent_id"
],
$params
[
"start_time"
],
$params
[
"end_time"
],
$params
[
"is_case"
],
$house_id
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
catch
(
Exception
$exception
)
{
return
$this
->
response
(
"101"
,
"request error,msg:"
.
$exception
);
}
}
}
\ No newline at end of file
application/api_broker/service/PerformanceService.php
View file @
1345d92a
...
@@ -145,12 +145,12 @@ class PerformanceService
...
@@ -145,12 +145,12 @@ class PerformanceService
$result
=
[];
$result
=
[];
switch
(
$is_case
)
{
switch
(
$is_case
)
{
case
1
:
case
1
:
$now_date
=
date
(
"Y-m-d"
,
time
());
/*
$now_date = date("Y-m-d", time());
if
(
$start_time
==
$now_date
&&
$end_time
==
$now_date
)
{
if ($start_time == $now_date && $end_time == $now_date) {
*/
$params
[
"agent_id"
]
=
$agent_id
;
$params
[
"agent_id"
]
=
$agent_id
;
$params
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$params
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$result
=
$this
->
nowTimeSum
(
$params
,
1
);
$result
=
$this
->
nowTimeSum
(
$params
,
1
);
}
else
{
/*
} else {
$field = "agent_id,sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num,
$field = "agent_id,sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num,
sum(performance) as performance,sum(official_receipts) as official_receipts,sum(look_at_num) as look_at_num,
sum(performance) as performance,sum(official_receipts) as official_receipts,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";
sum(march_in_num) as march_in_num , sum(paylog) as paylog , sum(bargain_sum) as bargain_sum";
...
@@ -162,7 +162,7 @@ class PerformanceService
...
@@ -162,7 +162,7 @@ class PerformanceService
if (count($list) > 0) {
if (count($list) > 0) {
$result = $list[0];
$result = $list[0];
}
}
}
}
*/
break
;
break
;
case
2
:
//案场
case
2
:
//案场
$house_id_arr
=
[];
$house_id_arr
=
[];
...
@@ -339,11 +339,11 @@ class PerformanceService
...
@@ -339,11 +339,11 @@ class PerformanceService
$params
[
"district_id"
]
=
$result
[
0
][
"district_id"
];
$params
[
"district_id"
]
=
$result
[
0
][
"district_id"
];
}
}
$list
=
[];
//
$list = [];
$now_date
=
date
(
"Y-m-d"
,
time
());
//
$now_date = date("Y-m-d", time());
if
(
$start_time
==
$now_date
&&
$end_time
==
$now_date
)
{
//
if ($start_time == $now_date && $end_time == $now_date) {
$verify
=
new
VerifyService
();
$verify
=
new
VerifyService
();
$agent_ids
=
$verify
->
getAgentsByAgentId
(
$agent_id
);
$agent_ids
=
$verify
->
getAgentsByAgentId
(
$agent_id
);
...
@@ -353,7 +353,7 @@ class PerformanceService
...
@@ -353,7 +353,7 @@ class PerformanceService
$list
=
$this
->
sumDistrictPerformance
(
$where_
);
$list
=
$this
->
sumDistrictPerformance
(
$where_
);
// dump($list);exit;
// dump($list);exit;
}
else
{
/*
} else {
$field = "sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num,
$field = "sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num,
sum(performance) as performance,sum(official_receipts) as official_receipts,sum(look_at_num) as look_at_num,
sum(performance) as performance,sum(official_receipts) as official_receipts,sum(look_at_num) as look_at_num,
sum(march_in_num) as march_in_num,sum(paylog) as paylog,sum(supervision_num) as supervision_num";
sum(march_in_num) as march_in_num,sum(paylog) as paylog,sum(supervision_num) as supervision_num";
...
@@ -365,7 +365,7 @@ class PerformanceService
...
@@ -365,7 +365,7 @@ class PerformanceService
if (count($list) > 0) {
if (count($list) > 0) {
$list = $list[0];
$list = $list[0];
}
}
}
}
*/
if
(
count
(
$list
)
>
0
)
{
if
(
count
(
$list
)
>
0
)
{
return
$list
;
return
$list
;
...
...
application/api_broker/service/PerformanceUtilService.php
View file @
1345d92a
...
@@ -2,13 +2,8 @@
...
@@ -2,13 +2,8 @@
namespace
app\api_broker\service
;
namespace
app\api_broker\service
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\ASuperviseModel
;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\GHousesImgs
;
use
app\model\OBargainModel
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\OPayLogModel
;
use
app\model\OReportModel
;
use
app\model\TAgentTotalModel
;
use
app\model\TAgentTotalModel
;
use
app\model\Users
;
use
app\model\Users
;
...
@@ -24,6 +19,8 @@ class PerformanceUtilService
...
@@ -24,6 +19,8 @@ class PerformanceUtilService
{
{
private
$totalModel
;
private
$totalModel
;
private
$agentModel
;
private
$agentModel
;
private
$agentsModel
;
private
$tAgentTotalModel
;
private
$houseModel
;
private
$houseModel
;
private
$userModel
;
private
$userModel
;
private
$bargainModel
;
private
$bargainModel
;
...
@@ -37,6 +34,8 @@ class PerformanceUtilService
...
@@ -37,6 +34,8 @@ class PerformanceUtilService
{
{
$this
->
totalModel
=
new
TAgentTotalModel
();
$this
->
totalModel
=
new
TAgentTotalModel
();
$this
->
agentModel
=
new
AAgents
();
$this
->
agentModel
=
new
AAgents
();
$this
->
agentsModel
=
new
AAgents
();
$this
->
tAgentTotalModel
=
new
TAgentTotalModel
();
$this
->
houseModel
=
new
GHouses
();
$this
->
houseModel
=
new
GHouses
();
$this
->
userModel
=
new
Users
();
$this
->
userModel
=
new
Users
();
$this
->
bargainModel
=
new
OBargainModel
();
$this
->
bargainModel
=
new
OBargainModel
();
...
@@ -47,21 +46,9 @@ class PerformanceUtilService
...
@@ -47,21 +46,9 @@ class PerformanceUtilService
$this
->
superviseModel
=
new
ASuperviseModel
();
$this
->
superviseModel
=
new
ASuperviseModel
();
}
}
private
function
isExcuseToday
(
$time
)
:
bool
{
public
function
HouseNum
()
$now_date
=
date
(
"Y-m-d"
,
time
());
if
(
$time
==
$now_date
)
{
return
true
;
}
return
false
;
}
public
function
HouseNum
(
$start_time
,
$end_time
,
$agent_ids
)
{
{
$is_today
=
$this
->
isExcuseToday
(
$end_time
);
if
(
$is_today
){
}
}
}
private
function
sumDistrictPerformance
(
$params
)
private
function
sumDistrictPerformance
(
$params
)
...
...
application/model/OBargainModel.php
View file @
1345d92a
...
@@ -698,7 +698,7 @@ class OBargainModel extends Model
...
@@ -698,7 +698,7 @@ class OBargainModel extends Model
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
where
(
$where_
)
->
where
(
$where_
)
->
select
();
->
select
();
//
dump($this->getLastSql()
);
//
echo $this->getLastSql(
);
return
$return
;
return
$return
;
}
}
...
...
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