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
63e6cfb1
Commit
63e6cfb1
authored
Dec 06, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
175de13d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
RankingListService.php
application/index/service/RankingListService.php
+10
-8
AStore.php
application/model/AStore.php
+4
-1
No files found.
application/index/service/RankingListService.php
View file @
63e6cfb1
...
@@ -138,12 +138,14 @@ class RankingListService
...
@@ -138,12 +138,14 @@ class RankingListService
*/
*/
public
function
StoreRankingList
(
$siteId
){
public
function
StoreRankingList
(
$siteId
){
$begin_time
=
date
(
'Y-m-01 00:00:00'
,
strtotime
(
'-3 month'
));
$begin_time
=
date
(
'Y-m-01 00:00:00'
,
strtotime
(
'-3 month'
));
$end_time
=
date
(
"Y-m-d 23:59:59"
,
strtotime
(
-
date
(
'd'
)
.
'day'
));
$end_time
=
date
(
"Y-m-d 23:59:59"
,
strtotime
(
-
date
(
'd'
)
.
'day'
));
$params
[
"a.site_id"
]
=
$siteId
;
$params
[
"a.site_id"
]
=
$siteId
;
$params
[
"a.status"
]
=
0
;
$params
[
"a.status"
]
=
0
;
$params
[
"a.id"
]
=
array
(
"not in"
,
"5288,3742,5292"
);
$params
[
'b.total_time'
]
=
array
(
'between'
,
array
(
$begin_time
,
$end_time
));
$params
[
'b.total_time'
]
=
array
(
'between'
,
array
(
$begin_time
,
$end_time
));
$resultArr
=
$this
->
getStoreSort
(
$params
,
$begin_time
,
$end_time
,
""
);
$resultArr
=
$this
->
getStoreSort
(
$params
,
$begin_time
,
$end_time
,
""
,
$notIds
=
"5288,3742,5292"
);
if
(
count
(
$resultArr
)
<=
0
)
{
if
(
count
(
$resultArr
)
<=
0
)
{
return
null
;
return
null
;
}
}
...
@@ -178,20 +180,20 @@ class RankingListService
...
@@ -178,20 +180,20 @@ class RankingListService
* @param $begin_time
* @param $begin_time
* @param $end_time
* @param $end_time
* @param $ids
* @param $ids
* @param $notIds
* @return array
* @return array
* @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
*/
*/
private
function
getStoreSort
(
$params
,
$begin_time
,
$end_time
,
$ids
)
private
function
getStoreSort
(
$params
,
$begin_time
,
$end_time
,
$ids
,
$notIds
=
""
)
{
{
$storeModel
=
new
AStore
();
$storeModel
=
new
AStore
();
$fields
=
"a.id,a.store_name,SUM(b.performance) as performance"
;
$fields
=
"a.id,a.store_name,SUM(b.performance) as performance"
;
//$params["a.id"] = array("not in","5288,3742,5292");
//查询出有业绩的经纪人
//查询出有业绩的经纪人
$have_performance_arr
=
$storeModel
->
getStoreListByPK
(
$fields
,
$params
);
$have_performance_arr
=
$storeModel
->
getStoreListByPK
(
$fields
,
$params
);
//查询出无业绩的经纪人
//查询出无业绩的经纪人
$arr
=
$storeModel
->
getStoreListByPk1
(
$params
[
"a.site_id"
],
$begin_time
,
$end_time
,
$ids
);
$arr
=
$storeModel
->
getStoreListByPk1
(
$params
[
"a.site_id"
],
$begin_time
,
$end_time
,
$ids
,
$notIds
);
return
array_merge
(
$have_performance_arr
,
$arr
);
return
array_merge
(
$have_performance_arr
,
$arr
);
}
}
...
...
application/model/AStore.php
View file @
63e6cfb1
...
@@ -301,11 +301,14 @@ class AStore extends BaseModel
...
@@ -301,11 +301,14 @@ class AStore extends BaseModel
//echo $this->getLastSql();
//echo $this->getLastSql();
return
$data
;
return
$data
;
}
}
public
function
getStoreListByPk1
(
$siteId
,
$startTime
,
$endTime
,
$ids
){
public
function
getStoreListByPk1
(
$siteId
,
$startTime
,
$endTime
,
$ids
,
$notIds
){
$str_ids
=
" "
;
$str_ids
=
" "
;
if
(
$ids
){
if
(
$ids
){
$str_ids
=
" and a.id in (
$ids
)"
;
$str_ids
=
" and a.id in (
$ids
)"
;
}
}
if
(
$notIds
){
$str_ids
.=
" and a.id not in (
$notIds
) "
;
}
$sql
=
"select aa.id,aa.store_name,aa.performance from
$sql
=
"select aa.id,aa.store_name,aa.performance from
(select a.id,a.store_name,0.00 as performance from a_store a
(select a.id,a.store_name,0.00 as performance from a_store a
...
...
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