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
2bab2e87
Commit
2bab2e87
authored
Jun 07, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
c93dce7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
19 deletions
+28
-19
ResultsSummaryTask.php
application/task/controller/ResultsSummaryTask.php
+28
-19
No files found.
application/task/controller/ResultsSummaryTask.php
View file @
2bab2e87
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
app\task\controller
;
namespace
app\task\controller
;
use
app\extra\RedisExt
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\OBargainModel
;
use
app\model\OBargainModel
;
...
@@ -29,6 +30,7 @@ class ResultsSummaryTask
...
@@ -29,6 +30,7 @@ class ResultsSummaryTask
private
$reportModel
;
private
$reportModel
;
private
$marchInModel
;
private
$marchInModel
;
private
$payLogModel
;
private
$payLogModel
;
private
$redis_
;
function
__construct
()
function
__construct
()
{
{
...
@@ -40,30 +42,37 @@ class ResultsSummaryTask
...
@@ -40,30 +42,37 @@ class ResultsSummaryTask
$this
->
reportModel
=
new
OReportModel
();
$this
->
reportModel
=
new
OReportModel
();
$this
->
marchInModel
=
new
OMarchInModel
();
$this
->
marchInModel
=
new
OMarchInModel
();
$this
->
payLogModel
=
new
OPayLogModel
();
$this
->
payLogModel
=
new
OPayLogModel
();
$this
->
redis_
=
RedisExt
::
getRedis
();
}
}
public
function
totalAgentResults
()
public
function
totalAgentResults
()
{
{
set_time_limit
(
0
);
// 取消脚本运行时间的超时上限
set_time_limit
(
0
);
// 取消脚本运行时间的超时上限
//todo 1.分页查询经纪人, 2遍历执行,判断一个经纪人在统计表最后一条统计数据的日期
//TODO 3.日期加一天并判断是否大于等于当前时间大于return 4.执行此日期的统计,5.当次日期小于当前日期,递归日期加一。继续统计
$day
=
date
(
"Y-m-d"
,
time
());
$total
=
$this
->
agentsModel
->
getAgentsCountByTask
();
if
(
$this
->
redis_
&&
$this
->
redis_
->
get
(
"run_total"
.
$day
))
{
return
false
;
$pageSize
=
200
;
}
$pageTotal
=
ceil
(
$total
/
$pageSize
);
$this
->
redis_
->
set
(
"run_total"
.
$day
,
1
,
24
*
3600
);
for
(
$pageNo
=
1
;
$pageNo
<=
$pageTotal
;
$pageNo
++
)
{
//todo 1.分页查询经纪人, 2遍历执行,判断一个经纪人在统计表最后一条统计数据的日期
$resultArr
=
$this
->
agentsModel
->
getAgentsListByTask
(
$pageNo
,
$pageSize
,
"id,store_id,district_id"
);
//TODO 3.日期加一天并判断是否大于等于当前时间大于return 4.执行此日期的统计,5.当次日期小于当前日期,递归日期加一。继续统计
$this
->
executeTotal
(
$resultArr
);
$total
=
$this
->
agentsModel
->
getAgentsCountByTask
();
unset
(
$resultArr
);
}
$pageSize
=
200
;
unset
(
$this
->
agentsModel
);
$pageTotal
=
ceil
(
$total
/
$pageSize
);
unset
(
$this
->
tAgentTotalModel
);
for
(
$pageNo
=
1
;
$pageNo
<=
$pageTotal
;
$pageNo
++
)
{
unset
(
$this
->
houseModel
);
$resultArr
=
$this
->
agentsModel
->
getAgentsListByTask
(
$pageNo
,
$pageSize
,
"id,store_id,district_id"
);
unset
(
$this
->
userModel
);
$this
->
executeTotal
(
$resultArr
);
unset
(
$this
->
bargainModel
);
unset
(
$resultArr
);
unset
(
$this
->
reportModel
);
}
unset
(
$this
->
marchInModel
);
unset
(
$this
->
agentsModel
);
unset
(
$this
->
payLogModel
);
unset
(
$this
->
tAgentTotalModel
);
unset
(
$this
->
houseModel
);
unset
(
$this
->
userModel
);
unset
(
$this
->
bargainModel
);
unset
(
$this
->
reportModel
);
unset
(
$this
->
marchInModel
);
unset
(
$this
->
payLogModel
);
}
}
...
...
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