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
d8ccd6a9
Commit
d8ccd6a9
authored
Jul 08, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6391460f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
18 deletions
+33
-18
UserAgentService.php
application/index/service/UserAgentService.php
+16
-15
UserAgentModel.php
application/model/UserAgentModel.php
+7
-0
Users.php
application/model/Users.php
+10
-3
No files found.
application/index/service/UserAgentService.php
View file @
d8ccd6a9
...
...
@@ -103,20 +103,20 @@ class UserAgentService
/**
* 搬家
*/
public
function
moveHouse
(){
$pageNo
=
1
;
$pageSize
=
10
;
$field
=
"id as user_id,b.id as agent_id,b.site_id"
;
$user_list
=
$this
->
m_user
->
moveHouse
(
$field
,
$pageNo
,
$pageSize
,
"a.id desc"
);
/**
`user_id` int(10) DEFAULT NULL,
`site_id` int(6) DEFAULT '10001' COMMENT '站点id ',
`agent_id` int(10) DEFAULT NULL COMMENT '经纪人id注意:上海的客方可以是杭州的经纪人',
`is_del` tinyint(1) DEFAULT '0' COMMENT '是否删除 0正常 1删除',
`create_time` timestamp NULL DEFAULT NULL,
`update_time`
*/
return
$user_list
;
public
function
moveHouse
(
$pageNo
=
1
,
$pageSize
=
100
){
$field
=
"a.id as user_id,b.id as agent_id,b.site_id"
;
$params
[]
=
[
'EXP'
,
'b.site_id IS NOT NULL '
];
$user_list
=
$this
->
m_user
->
moveHouse
(
$field
,
$params
,
$pageNo
,
$pageSize
,
"a.id asc"
);
foreach
(
$user_list
as
$k1
=>
$v1
)
{
$user_list
[
$k1
][
'create_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
);
return
$user_insert
;
}
}
\ No newline at end of file
application/model/UserAgentModel.php
View file @
d8ccd6a9
...
...
@@ -127,4 +127,11 @@ class UserAgentModel extends Model
->
select
();
return
$result
;
}
public
function
moveHouseInsertAll
(
$data
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
insertAll
(
$data
);
return
$result
;
}
}
application/model/Users.php
View file @
d8ccd6a9
...
...
@@ -1113,18 +1113,25 @@ class Users extends Model
->
select
();
}
public
function
moveHouse
(
$field
,
$pageNo
,
$pageSize
,
$order
)
public
function
moveHouse
(
$field
,
$pa
rams
,
$pa
geNo
,
$pageSize
,
$order
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"b.
agent_id=a.
id"
,
"left"
)
->
join
(
"a_agents b"
,
"b.
id=a.agent_
id"
,
"left"
)
->
field
(
$field
)
//
->where($params)
->
where
(
$params
)
->
order
(
$order
)
->
page
(
$pageNo
)
->
limit
(
$pageSize
)
->
select
();
return
$result
;
}
public
function
moveHouseInsertAll
(
$data
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
insertAll
(
$data
);
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