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
75bc136f
Commit
75bc136f
authored
Jul 15, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5bfad4aa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
17 deletions
+16
-17
User.php
application/api_broker/controller/User.php
+2
-2
UserAgentService.php
application/index/service/UserAgentService.php
+14
-15
No files found.
application/api_broker/controller/User.php
View file @
75bc136f
...
...
@@ -911,8 +911,8 @@ class User extends Basic
*/
public
function
moveHouseAgent
()
{
ini_set
(
'memory_limit'
,
'500M'
);
//内存限制
set_time_limit
(
0
);
//
//
ini_set('memory_limit', '500M'); //内存限制
//
set_time_limit(0); //
$s_user_agent
=
new
UserAgentService
();
$res
=
$s_user_agent
->
moveHouse
();
return
$res
;
...
...
application/index/service/UserAgentService.php
View file @
75bc136f
...
...
@@ -104,9 +104,6 @@ class UserAgentService
* 处理老数据
*/
public
function
moveHouse
(){
ini_set
(
'memory_limit'
,
'500M'
);
//内存限制
set_time_limit
(
0
);
//
$limit
=
1000
;
$user_count
=
$this
->
moveHouseCount
();
...
...
@@ -115,9 +112,8 @@ class UserAgentService
for
(
$page
=
1
;
$page
<=
$total_page
;
$page
++
)
{
$res
=
$this
->
moveHouseSaveData
(
$page
,
$limit
);
big_log
(
$res
);
}
return
true
;
return
''
;
}
/**
...
...
@@ -130,18 +126,11 @@ class UserAgentService
$field
=
"a.id as user_id,b.id as agent_id,a.site_ids as site_id,a.create_time"
;
$params
[]
=
[
'EXP'
,
'a.site_ids IS NOT NULL AND a.agent_id IS NOT NULL AND a.agent_id > 0'
];
$user_list
=
$this
->
m_user
->
moveHouse
(
$field
,
$params
,
$page
,
$limit
,
"a.id asc"
);
$user_list_
=
[];
foreach
(
$user_list
as
$k
=>
$v
)
{
$site_ids
=
explode
(
','
,
$v
[
'site_id'
]);
foreach
(
$site_ids
as
$k1
=>
$v1
)
{
// dump($v1);exit;
$is_save
=
$this
->
isSaveEd
(
$v
[
'user_id'
],
$v
[
'agent_id'
],
$v
[
'site_id'
]);
big_log
(
'检查是否已经存在数据!'
);
big_log
(
$is_save
);
if
(
$is_save
){
big_log
(
'存在跳出循环!'
);
continue
;
}
$a
=
[];
$a
[
'user_id'
]
=
$v
[
'user_id'
];
$a
[
'site_id'
]
=
$v1
;
...
...
@@ -151,9 +140,19 @@ class UserAgentService
$user_list_
[]
=
$a
;
}
}
// dump($user_list_);exit;
foreach
(
$user_list_
as
$k2
=>
$v2
)
{
$is_save
=
$this
->
isSaveEd
(
$v2
[
'user_id'
],
$v2
[
'agent_id'
],
$v2
[
'site_id'
]);
if
(
$is_save
){
unset
(
$user_list_
[
$k2
]);
}
}
if
(
$user_list_
){
$user_insert
=
$this
->
m_user_agent
->
moveHouseInsertAll
(
$user_list_
);
return
$user_insert
;
}
return
true
;
}
/**
...
...
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