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
c7147a2f
Commit
c7147a2f
authored
Jul 09, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d8fec578
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
11 deletions
+45
-11
ImageDepot.php
application/index/controller/ImageDepot.php
+15
-5
UserAgentService.php
application/index/service/UserAgentService.php
+17
-3
Users.php
application/model/Users.php
+13
-3
No files found.
application/index/controller/ImageDepot.php
View file @
c7147a2f
...
@@ -169,18 +169,28 @@ class ImageDepot extends Basic
...
@@ -169,18 +169,28 @@ class ImageDepot extends Basic
}
}
public
function
ceshi
()
public
function
ceshi
()
{
{
// $s = new PositionService();
// $s = new PositionService();
//
// // $res = $s->getPositionDistance('31.067059,121.518854','31.079655,121.51713');
// // $res = $s->getPositionDistance('31.067059,121.518854','31.079655,121.51713');
// $res = $s->getPositionDistance('31.170841,121.463858','31.17265,121.464914');
// $res = $s->getPositionDistance('31.170841,121.463858','31.17265,121.464914');
// dump($res);
// dump($res);
$s
=
new
UserAgentService
();
$s_user_agent
=
new
UserAgentService
();
$res
=
$s
->
moveHouse
();
$user_count
=
$s_user_agent
->
moveHouseCount
();
dump
(
$res
);
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);
}
}
...
...
application/index/service/UserAgentService.php
View file @
c7147a2f
...
@@ -77,7 +77,7 @@ class UserAgentService
...
@@ -77,7 +77,7 @@ class UserAgentService
{
{
$params
[
'user_id'
]
=
$user_id
;
$params
[
'user_id'
]
=
$user_id
;
$field
=
'd.name as site_name,c.name as agent_name,c.phone as agent_phone'
;
$field
=
'
a.site_id,a.agent_id,
d.name as site_name,c.name as agent_name,c.phone as agent_phone'
;
$user_agent_info
=
$this
->
m_user_agent
->
selectUserAgent
(
$field
,
$params
);
$user_agent_info
=
$this
->
m_user_agent
->
selectUserAgent
(
$field
,
$params
);
if
(
!
$user_agent_info
){
if
(
!
$user_agent_info
){
return
false
;
return
false
;
...
@@ -102,11 +102,14 @@ class UserAgentService
...
@@ -102,11 +102,14 @@ class UserAgentService
/**
/**
* 搬家
* 搬家
* @param int $page
* @param int $limit
* @return int|string
*/
*/
public
function
moveHouse
(
$page
No
=
1
,
$pageSize
=
100
){
public
function
moveHouse
(
$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
No
,
$pageSize
,
"a.id asc"
);
$user_list
=
$this
->
m_user
->
moveHouse
(
$field
,
$params
,
$page
,
$limit
,
"a.id asc"
);
foreach
(
$user_list
as
$k1
=>
$v1
)
{
foreach
(
$user_list
as
$k1
=>
$v1
)
{
$user_list
[
$k1
][
'create_time'
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$user_list
[
$k1
][
'create_time'
]
=
date
(
"Y-m-d H:i:s"
,
time
());
...
@@ -118,5 +121,15 @@ class UserAgentService
...
@@ -118,5 +121,15 @@ class UserAgentService
return
$user_insert
;
return
$user_insert
;
}
}
/*
* 符合要求的客户数量
*/
public
function
moveHouseCount
(){
$params
[]
=
[
'EXP'
,
'b.site_id IS NOT NULL '
];
$user_count
=
$this
->
m_user
->
moveHouseCount
(
$params
);
return
$user_count
;
}
}
}
\ No newline at end of file
application/model/Users.php
View file @
c7147a2f
...
@@ -1113,7 +1113,7 @@ class Users extends Model
...
@@ -1113,7 +1113,7 @@ class Users extends Model
->
select
();
->
select
();
}
}
public
function
moveHouse
(
$field
,
$params
,
$page
No
,
$pageSize
,
$order
)
public
function
moveHouse
(
$field
,
$params
,
$page
,
$limit
,
$order
)
{
{
$result
=
Db
::
table
(
$this
->
table
)
$result
=
Db
::
table
(
$this
->
table
)
->
alias
(
"a"
)
->
alias
(
"a"
)
...
@@ -1121,12 +1121,22 @@ class Users extends Model
...
@@ -1121,12 +1121,22 @@ class Users extends Model
->
field
(
$field
)
->
field
(
$field
)
->
where
(
$params
)
->
where
(
$params
)
->
order
(
$order
)
->
order
(
$order
)
->
page
(
$page
No
)
->
page
(
$page
)
->
limit
(
$
pageSize
)
->
limit
(
$
limit
)
->
select
();
->
select
();
return
$result
;
return
$result
;
}
}
public
function
moveHouseCount
(
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"b.id=a.agent_id"
,
"left"
)
->
where
(
$params
)
->
count
();
return
$result
;
}
public
function
moveHouseInsertAll
(
$data
)
public
function
moveHouseInsertAll
(
$data
)
{
{
$result
=
Db
::
table
(
$this
->
table
)
$result
=
Db
::
table
(
$this
->
table
)
...
...
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