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
90b82782
Commit
90b82782
authored
Aug 13, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
房东手机号转换
parent
d56fea3f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
26 deletions
+55
-26
HouseInfo.php
application/index/controller/HouseInfo.php
+0
-26
Houses.php
application/index/controller/Houses.php
+38
-0
GLandlordPhone.php
application/model/GLandlordPhone.php
+17
-0
No files found.
application/index/controller/HouseInfo.php
deleted
100644 → 0
View file @
d56fea3f
<?php
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\HouseInfos
;
use
think\Request
;
/**
* Description of HouseInfo
*
* @author : fuju
* @date : 2018-1-15 11:09:56
* @internal : description
*/
class
HouseInfo
extends
Basic
{
protected
$house_infos
;
public
function
__construct
(
Request
$request
)
{
parent
::
__construct
(
$request
);
$this
->
house_infos
=
new
HouseInfos
();
}
public
function
index
()
{
return
$this
->
house_infos
->
select
();
}
}
application/index/controller/Houses.php
View file @
90b82782
...
...
@@ -15,8 +15,10 @@ use app\index\validate\HouseValidate;
use
app\model\AAgents
;
use
app\model\ACollectHouse
;
use
app\model\GHouses
;
use
app\model\GHousesExt
;
use
app\model\GHousesImgs
;
use
app\model\GHousesToAgents
;
use
app\model\GLandlordPhone
;
use
app\model\GOperatingRecords
;
use
app\model\SubletModel
;
use
think\Request
;
...
...
@@ -505,4 +507,39 @@ class Houses extends Basic
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
/**
* 转换房东手机号
*
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
transformLandlord
()
{
$time
=
time
();
$m_landlord
=
new
GLandlordPhone
();
$m_house
=
new
GHousesExt
();
$total
=
$m_house
->
getTotal
();
$page
=
ceil
(
$total
/
5000
);
$where
[]
=
[
'EXP'
,
'landlord_phone IS NOT NULL AND landlord_phone != ""'
];
$kk
=
0
;
for
(
$i
=
1
;
$i
<=
$page
;
$i
++
)
{
$data
=
$m_house
->
getList
(
$i
,
5000
,
'id asc'
,
'house_id,landlord_phone'
,
$where
);
foreach
(
$data
as
$k
=>
$v
)
{
$landlord_data
=
json_decode
(
$v
[
'landlord_phone'
],
true
);
foreach
(
$landlord_data
as
$k2
=>
$v2
)
{
$insert
[
$kk
][
'name'
]
=
$v2
[
'name'
];
$insert
[
$kk
][
'phone'
]
=
(
int
)
$v2
[
'phone'
];
$insert
[
$kk
][
'house_id'
]
=
$v
[
'house_id'
];
$kk
++
;
}
}
$m_landlord
->
saveAll
(
$insert
);
}
echo
time
()
-
$time
.
'秒'
;
}
}
\ No newline at end of file
application/model/GLandlordPhone.php
0 → 100644
View file @
90b82782
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/8/13
* Time: 15:56
*/
namespace
app\model
;
class
GLandlordPhone
extends
BaseModel
{
protected
$table
=
'g_landlord_phone'
;
}
\ 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