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
e88021f2
Commit
e88021f2
authored
Jul 09, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
7f4f294c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
17 deletions
+23
-17
ImageDepot.php
application/index/controller/ImageDepot.php
+2
-13
UserAgentService.php
application/index/service/UserAgentService.php
+20
-3
UserService.php
application/index/service/UserService.php
+1
-1
No files found.
application/index/controller/ImageDepot.php
View file @
e88021f2
...
@@ -177,19 +177,8 @@ class ImageDepot extends Basic
...
@@ -177,19 +177,8 @@ class ImageDepot extends Basic
// dump($res);
// dump($res);
$s_user_agent
=
new
UserAgentService
();
$s_user_agent
=
new
UserAgentService
();
$user_count
=
$s_user_agent
->
moveHouseCount
();
$res
=
$s_user_agent
->
moveHouse
();
dump
(
$user_count
);
$limit
=
100
;
$total_page
=
intval
(
$user_count
/
$limit
)
+
((
$user_count
%
$limit
==
0
)
?
0
:
1
);
dump
(
$total_page
);
for
(
$page
=
1
;
$page
<=
$total_page
;
$page
++
)
{
// $res = $s_user_agent->moveHouse($page,$limit);
// if($page == 10){
// exit;
// }
}
// dump($res);
// dump($res);
}
}
...
...
application/index/service/UserAgentService.php
View file @
e88021f2
...
@@ -101,12 +101,30 @@ class UserAgentService
...
@@ -101,12 +101,30 @@ class UserAgentService
/**
/**
* 搬家
* 处理老数据
*/
public
function
moveHouse
(){
$limit
=
100
;
$user_count
=
$this
->
moveHouseCount
();
$total_page
=
intval
(
$user_count
/
$limit
)
+
((
$user_count
%
$limit
==
0
)
?
0
:
1
);
for
(
$page
=
1
;
$page
<=
$total_page
;
$page
++
)
{
// $res = $s_user_agent->moveHouse($page,$limit);
// if($page == 10){
// exit;
// }
}
}
/**
* 保存数据
* @param int $page
* @param int $page
* @param int $limit
* @param int $limit
* @return int|string
* @return int|string
*/
*/
public
function
moveHouse
(
$page
=
1
,
$limit
=
100
){
public
function
moveHouse
SaveData
(
$page
=
1
,
$limit
=
100
){
$field
=
"a.id as user_id,b.id as agent_id,b.site_id"
;
$field
=
"a.id as user_id,b.id as agent_id,b.site_id"
;
$params
[]
=
[
'EXP'
,
'b.site_id IS NOT NULL '
];
$params
[]
=
[
'EXP'
,
'b.site_id IS NOT NULL '
];
$user_list
=
$this
->
m_user
->
moveHouse
(
$field
,
$params
,
$page
,
$limit
,
"a.id asc"
);
$user_list
=
$this
->
m_user
->
moveHouse
(
$field
,
$params
,
$page
,
$limit
,
"a.id asc"
);
...
@@ -116,7 +134,6 @@ class UserAgentService
...
@@ -116,7 +134,6 @@ class UserAgentService
$user_list
[
$k1
][
'update_time'
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$user_list
[
$k1
][
'update_time'
]
=
date
(
"Y-m-d H:i:s"
,
time
());
}
}
dump
(
$user_list
);
$user_insert
=
$this
->
m_user_agent
->
moveHouseInsertAll
(
$user_list
);
$user_insert
=
$this
->
m_user_agent
->
moveHouseInsertAll
(
$user_list
);
return
$user_insert
;
return
$user_insert
;
}
}
...
...
application/index/service/UserService.php
View file @
e88021f2
...
@@ -129,7 +129,7 @@ class UserService
...
@@ -129,7 +129,7 @@ class UserService
$s_user_agent
->
addUserAgent
(
$data
[
'agents_id'
],
$id
,
$site_id
);
$s_user_agent
->
addUserAgent
(
$data
[
'agents_id'
],
$id
,
$site_id
);
}
else
{
}
else
{
if
(
!
empty
(
$data
[
'agents_id'
])
&&
(
$data
[
'agents_id'
]
!=
$agent_id_old
))
{
if
(
!
empty
(
$data
[
'agents_id'
])
&&
(
$data
[
'agents_id'
]
!=
$agent_id_old
))
{
$s_user_agent
->
changeUserAgent
(
$data
[
'agent_id'
],
$id
,
$site_id
);
$s_user_agent
->
changeUserAgent
(
$data
[
'agent
s
_id'
],
$id
,
$site_id
);
}
}
}
}
...
...
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