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
5b776c20
Commit
5b776c20
authored
Sep 18, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
21a94415
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
27 deletions
+36
-27
PerformanceService.php
application/api_broker/service/PerformanceService.php
+24
-26
AAgents.php
application/model/AAgents.php
+12
-1
No files found.
application/api_broker/service/PerformanceService.php
View file @
5b776c20
...
@@ -383,14 +383,15 @@ class PerformanceService
...
@@ -383,14 +383,15 @@ class PerformanceService
foreach
(
$list
as
$key
=>
$item
)
{
foreach
(
$list
as
$key
=>
$item
)
{
if
(
$is_store
==
2
)
{
if
(
$is_store
==
2
)
{
$fields
=
"a.name,b.store_name"
;
$fields
=
"a.name,b.store_name"
;
$where_
[
"a.level"
]
=
array
(
'in'
,
"20,40"
);
$where_
[
"a.level"
]
=
array
(
'in'
,
"20,40"
);
$where_
[
"a.store_id"
]
=
$item
[
"store_id"
];
$where_
[
"c.id"
]
=
$item
[
"agent_id"
];
}
else
{
}
else
{
$fields
=
"c.name,b.store_name"
;
$fields
=
"a.name,b.store_name"
;
$where_
[
"a.id"
]
=
$item
[
"agent_id"
];
}
}
$where_
[
"a.store_id"
]
=
$item
[
"store_id"
];
$info
=
$this
->
agentModel
->
getStoreOrAgentInfo
(
$fields
,
$where_
,
$is_store
);
$where_
[
"c.id"
]
=
$item
[
"agent_id"
];
$info
=
$this
->
agentModel
->
getStoreOrAgentInfo
(
$fields
,
$where_
);
if
(
count
(
$info
)
>
0
)
{
if
(
count
(
$info
)
>
0
)
{
$list
[
$key
][
"store_name"
]
=
$info
[
0
][
"store_name"
];
$list
[
$key
][
"store_name"
]
=
$info
[
0
][
"store_name"
];
$list
[
$key
][
"name"
]
=
$info
[
0
][
"name"
];
$list
[
$key
][
"name"
]
=
$info
[
0
][
"name"
];
...
@@ -461,6 +462,7 @@ class PerformanceService
...
@@ -461,6 +462,7 @@ class PerformanceService
return
$params
;
return
$params
;
}
}
/**
/**
* 获取房源数据
* 获取房源数据
* @param $type
* @param $type
...
@@ -570,7 +572,6 @@ class PerformanceService
...
@@ -570,7 +572,6 @@ class PerformanceService
}
}
/**
/**
* 获取收款数据
* 获取收款数据
* @param $agent_id
* @param $agent_id
...
@@ -596,7 +597,6 @@ class PerformanceService
...
@@ -596,7 +597,6 @@ class PerformanceService
}
}
/**
/**
* 获取业绩数据
* 获取业绩数据
* @param $type
* @param $type
...
@@ -668,7 +668,7 @@ class PerformanceService
...
@@ -668,7 +668,7 @@ class PerformanceService
return
[
"code"
=>
200
,
"date"
=>
$receivedList
];
return
[
"code"
=>
200
,
"date"
=>
$receivedList
];
}
}
public
function
paylogListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
public
function
paylogListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
...
@@ -693,7 +693,7 @@ class PerformanceService
...
@@ -693,7 +693,7 @@ class PerformanceService
* @param $page_size
* @param $page_size
* @return array
* @return array
*/
*/
public
function
marchInListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
public
function
marchInListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
...
@@ -705,10 +705,10 @@ class PerformanceService
...
@@ -705,10 +705,10 @@ class PerformanceService
$addMarchInListTotal
=
$this
->
marchInModel
->
getAddMarchInListPcInfoTotal
(
$params
,
$field
);
$addMarchInListTotal
=
$this
->
marchInModel
->
getAddMarchInListPcInfoTotal
(
$params
,
$field
);
//获取图片信息
//获取图片信息
foreach
(
$addMarchInList
as
$key
=>
$val
)
{
foreach
(
$addMarchInList
as
$key
=>
$val
)
{
$addMarchInList
[
$key
][
"user_name"
]
=
$val
[
"user_name"
]
?
$val
[
"user_name"
]
:
''
;
$addMarchInList
[
$key
][
"user_name"
]
=
$val
[
"user_name"
]
?
$val
[
"user_name"
]
:
''
;
$addMarchInList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
$addMarchInList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
}
return
[
"code"
=>
200
,
"date"
=>
$addMarchInList
,
"total"
=>
$addMarchInListTotal
];
return
[
"code"
=>
200
,
"date"
=>
$addMarchInList
,
"total"
=>
$addMarchInListTotal
];
}
}
...
@@ -722,7 +722,7 @@ class PerformanceService
...
@@ -722,7 +722,7 @@ class PerformanceService
* @param $page_size
* @param $page_size
* @return array
* @return array
*/
*/
public
function
getUserResourceListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
public
function
getUserResourceListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
...
@@ -756,7 +756,7 @@ class PerformanceService
...
@@ -756,7 +756,7 @@ class PerformanceService
* @param $page_size
* @param $page_size
* @return array
* @return array
*/
*/
public
function
getHousingResourceListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
public
function
getHousingResourceListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
...
@@ -793,7 +793,7 @@ class PerformanceService
...
@@ -793,7 +793,7 @@ class PerformanceService
* @param $page_size
* @param $page_size
* @return array
* @return array
*/
*/
public
function
getFollowListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
public
function
getFollowListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
...
@@ -803,11 +803,11 @@ class PerformanceService
...
@@ -803,11 +803,11 @@ class PerformanceService
$reportList
=
$this
->
reportModel
->
getAddReportListPcInfo
(
$params
,
$field
,
$page_no
,
$page_size
);
$reportList
=
$this
->
reportModel
->
getAddReportListPcInfo
(
$params
,
$field
,
$page_no
,
$page_size
);
$reportListTotal
=
$this
->
reportModel
->
getAddReportListPcInfoTotal
(
$params
,
$field
);
$reportListTotal
=
$this
->
reportModel
->
getAddReportListPcInfoTotal
(
$params
,
$field
);
foreach
(
$reportList
as
$key
=>
$val
)
{
foreach
(
$reportList
as
$key
=>
$val
)
{
$reportList
[
$key
][
"user_name"
]
=
$val
[
"user_name"
]
?
$val
[
"user_name"
]
:
''
;
$reportList
[
$key
][
"user_name"
]
=
$val
[
"user_name"
]
?
$val
[
"user_name"
]
:
''
;
$reportList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
$reportList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
}
//return [ "code" => 200, "date" => $reportList ];
//return [ "code" => 200, "date" => $reportList ];
return
[
"code"
=>
200
,
"date"
=>
$reportList
,
"total"
=>
$reportListTotal
];
return
[
"code"
=>
200
,
"date"
=>
$reportList
,
"total"
=>
$reportListTotal
];
}
}
...
@@ -821,23 +821,23 @@ class PerformanceService
...
@@ -821,23 +821,23 @@ class PerformanceService
* @param $page_size
* @param $page_size
* @return array
* @return array
*/
*/
public
function
getTeamNumPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
public
function
getTeamNumPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
{
if
(
$type
==
2
)
{
if
(
$type
==
2
)
{
$params
[
"a.store_id"
]
=
$id
;
$params
[
"a.store_id"
]
=
$id
;
}
else
{
}
else
{
$params
[
"a.district_id"
]
=
$id
;
$params
[
"a.district_id"
]
=
$id
;
}
}
//$params['a.create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
//$params['a.create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$field
=
"a.id,a.level,a.name,a.phone,a.create_time,b.store_name"
;
$field
=
"a.id,a.level,a.name,a.phone,a.create_time,b.store_name"
;
$list
=
$this
->
agentModel
->
searchAgentsByKeywordPcInfo
(
$field
,
$params
,
$page_size
,
$page_no
);
$list
=
$this
->
agentModel
->
searchAgentsByKeywordPcInfo
(
$field
,
$params
,
$page_size
,
$page_no
);
foreach
(
$list
as
$key
=>
$val
)
{
foreach
(
$list
as
$key
=>
$val
)
{
$follow
=
new
UPhoneFollowPp
();
$follow
=
new
UPhoneFollowPp
();
$res
=
$follow
->
getLastPhoneFollowTime
(
$val
[
'id'
]);
$res
=
$follow
->
getLastPhoneFollowTime
(
$val
[
'id'
]);
$list
[
$key
][
"user_name"
]
=
$val
[
"user_name"
]
?
$val
[
"user_name"
]
:
''
;
$list
[
$key
][
"user_name"
]
=
$val
[
"user_name"
]
?
$val
[
"user_name"
]
:
''
;
$list
[
$key
][
"last_phone_follow_time"
]
=
$res
[
0
][
'create_time'
]
?
$res
[
0
][
'create_time'
]
:
'暂无!'
;
$list
[
$key
][
"last_phone_follow_time"
]
=
$res
[
0
][
'create_time'
]
?
$res
[
0
][
'create_time'
]
:
'暂无!'
;
}
}
return
[
"code"
=>
200
,
"date"
=>
$list
];
return
[
"code"
=>
200
,
"date"
=>
$list
];
...
@@ -853,7 +853,7 @@ class PerformanceService
...
@@ -853,7 +853,7 @@ class PerformanceService
* @param $page_size
* @param $page_size
* @return array
* @return array
*/
*/
public
function
getBargainSumPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
,
$request_source_type
)
public
function
getBargainSumPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
,
$request_source_type
)
{
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
...
@@ -862,14 +862,13 @@ class PerformanceService
...
@@ -862,14 +862,13 @@ class PerformanceService
$field
=
"a.id,a.create_time,a.trade_type,a.scale_fee,c.landmark,d.user_phone,d.user_name,b.id as order_id"
;
$field
=
"a.id,a.create_time,a.trade_type,a.scale_fee,c.landmark,d.user_phone,d.user_name,b.id as order_id"
;
$m_bargain
=
new
OBargainModel
();
$m_bargain
=
new
OBargainModel
();
$list
=
$m_bargain
->
getBargainSumList
(
$field
,
$params
,
$page_size
,
$page_no
,
$request_source_type
);
$list
=
$m_bargain
->
getBargainSumList
(
$field
,
$params
,
$page_size
,
$page_no
,
$request_source_type
);
foreach
(
$list
as
$key
=>
$val
)
{
foreach
(
$list
as
$key
=>
$val
)
{
$list
[
$key
][
"user_name"
]
=
$val
[
"user_name"
]
?
$val
[
"user_name"
]
:
''
;
$list
[
$key
][
"user_name"
]
=
$val
[
"user_name"
]
?
$val
[
"user_name"
]
:
''
;
$list
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
$list
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
}
return
[
"code"
=>
200
,
"date"
=>
$list
];
return
[
"code"
=>
200
,
"date"
=>
$list
];
}
}
}
}
\ No newline at end of file
application/model/AAgents.php
View file @
5b776c20
...
@@ -692,13 +692,15 @@ class AAgents extends BaseModel
...
@@ -692,13 +692,15 @@ class AAgents extends BaseModel
/**
/**
* @param $field
* @param $field
* @param $params
* @param $params
* @param $is_store
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getStoreOrAgentInfo
(
$field
,
$params
)
public
function
getStoreOrAgentInfo
(
$field
,
$params
,
$is_store
)
{
{
if
(
$is_store
==
2
){
$result
=
Db
::
table
(
$this
->
table
)
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
field
(
$field
)
->
alias
(
"a"
)
->
alias
(
"a"
)
...
@@ -706,6 +708,15 @@ class AAgents extends BaseModel
...
@@ -706,6 +708,15 @@ class AAgents extends BaseModel
->
join
(
"a_agents c"
,
"a.store_id = c.store_id"
,
"left"
)
->
join
(
"a_agents c"
,
"a.store_id = c.store_id"
,
"left"
)
->
where
(
$params
)
->
where
(
$params
)
->
select
();
->
select
();
}
else
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_store b"
,
"a.store_id = b.id"
,
"left"
)
->
where
(
$params
)
->
select
();
}
// echo $this->getLastSql();
// echo $this->getLastSql();
return
$result
;
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