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
c4eb5b9d
Commit
c4eb5b9d
authored
Nov 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
转换房东手机号
parent
7a1b928a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
route.php
application/route.php
+2
-1
JobTask.php
application/task/controller/JobTask.php
+31
-0
No files found.
application/route.php
View file @
c4eb5b9d
...
...
@@ -517,7 +517,8 @@ Route::group('task', [
'updateShopAddress'
=>
[
'task/JobTask/updateShopAddress'
,
[
'method'
=>
'get'
]],
//默认图片
'updateShopAgeLimit'
=>
[
'task/JobTask/updateShopAgeLimit'
,
[
'method'
=>
'get'
]],
//默认年限
'push'
=>
[
'task/PushMessageTask/push'
,
[
'method'
=>
'get'
]]
//推送
'push'
=>
[
'task/PushMessageTask/push'
,
[
'method'
=>
'get'
]],
//推送
'updateLandlordLimit'
=>
[
'task/JobTask/updateLandlordLimit'
,
[
'method'
=>
'get'
]]
//转换房东手机号
]);
Route
::
group
(
'broker'
,
[
...
...
application/task/controller/JobTask.php
View file @
c4eb5b9d
...
...
@@ -6,6 +6,7 @@ use app\index\service\ImageDepotService;
use
app\model\GHouses
;
use
app\model\GHousesExt
;
use
app\model\GImageDepot
;
use
app\model\GLandlordPhone
;
use
think\Image
;
use
think\Request
;
...
...
@@ -20,11 +21,13 @@ class JobTask
{
private
$gHouseModel
;
private
$gHouseExtModel
;
private
$g_landlord_phone
;
public
function
__construct
()
{
$this
->
gHouseModel
=
new
GHouses
();
$this
->
gHouseExtModel
=
new
GHousesExt
();
$this
->
g_landlord_phone
=
new
GLandlordPhone
();
}
public
function
updateShopTask
()
...
...
@@ -154,4 +157,31 @@ class JobTask
}
}
}
//转换房东手机号
public
function
updateLandlordLimit
()
{
set_time_limit
(
0
);
// 取消脚本运行时间的超时上限
$field
=
"house_id,landlord_phone"
;
$params
[
'landlord_phone'
]
=
[
'<>'
,
''
];
$total
=
$this
->
gHouseExtModel
->
getTotal
(
$params
);
$pageSize
=
200
;
$pageTotal
=
ceil
(
$total
/
$pageSize
);
for
(
$pageNo
=
1
;
$pageNo
<=
$pageTotal
;
$pageNo
++
)
{
$save_data
=
[];
$houseList
=
$this
->
gHouseExtModel
->
getList
(
$pageNo
,
$pageSize
,
'id asc'
,
$field
,
$params
);
foreach
(
$houseList
as
$key
=>
$item
)
{
$tmp_data
=
json_decode
(
$item
[
'landlord_phone'
],
true
);
foreach
(
$tmp_data
as
$k
=>
$v
)
{
$data
[
'house_id'
]
=
$item
[
'house_id'
];
$data
[
'name'
]
=
$v
[
'name'
];
$data
[
'phone'
]
=
$v
[
'phone'
];
$save_data
[]
=
$data
;
}
}
$this
->
g_landlord_phone
->
insertData
(
$save_data
);
unset
(
$save_data
);
}
}
}
\ No newline at end of file
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