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
6e3c3b78
Commit
6e3c3b78
authored
Apr 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺数据转移
parent
838d7064
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
TransferHouseInfo.php
application/api/controller/TransferHouseInfo.php
+9
-4
No files found.
application/api/controller/TransferHouseInfo.php
View file @
6e3c3b78
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
namespace
app\api\controller
;
namespace
app\api\controller
;
use
app\model\Regions
;
use
think\Controller
;
use
think\Controller
;
use
think\Db
;
use
think\Db
;
...
@@ -20,7 +21,7 @@ class TransferHouseInfo extends Controller
...
@@ -20,7 +21,7 @@ class TransferHouseInfo extends Controller
*/
*/
public
function
table
()
{
public
function
table
()
{
$num
=
Db
::
table
(
'houseinfos'
)
->
order
(
'id desc'
)
->
value
(
'id'
);
$num
=
Db
::
table
(
'houseinfos'
)
->
order
(
'id desc'
)
->
value
(
'id'
);
$regions
=
new
Regions
();
for
(
$i
=
1
;
$i
<=
$num
;
$i
++
)
{
for
(
$i
=
1
;
$i
<=
$num
;
$i
++
)
{
$house_info_data
=
Db
::
table
(
'houseinfos'
)
->
field
(
'*'
)
$house_info_data
=
Db
::
table
(
'houseinfos'
)
->
field
(
'*'
)
->
where
(
'id'
,
$i
)
->
where
(
'id'
,
$i
)
...
@@ -38,10 +39,15 @@ class TransferHouseInfo extends Controller
...
@@ -38,10 +39,15 @@ class TransferHouseInfo extends Controller
$g_house_data
[
'external_title'
]
=
$house_info_data_ext
[
'foreign_name'
];
$g_house_data
[
'external_title'
]
=
$house_info_data_ext
[
'foreign_name'
];
$g_house_data
[
'internal_address'
]
=
$house_info_data
[
'address'
];
$g_house_data
[
'internal_address'
]
=
$house_info_data
[
'address'
];
$g_house_data
[
'external_address'
]
=
$house_info_data_ext
[
'address_detail_c'
];
$g_house_data
[
'external_address'
]
=
$house_info_data_ext
[
'address_detail_c'
];
$g_house_data
[
'province'
]
=
$house_info_data
[
'province'
]
;
$g_house_data
[
'province'
]
=
'上海'
;
$g_house_data
[
'city'
]
=
$house_info_data
[
'city'
];
$g_house_data
[
'city'
]
=
$house_info_data
[
'city'
];
$g_house_data
[
'disc'
]
=
$house_info_data
[
'disc'
];
$g_house_data
[
'disc'
]
=
$house_info_data
[
'disc'
];
// business_district_id
// business_district_id
if
(
$house_info_data
[
'city'
]
!=
''
)
{
$code_arr
=
$regions
->
getRegionsCodeByName
(
$g_house_data
[
'province'
],
$g_house_data
[
'city'
],
$g_house_data
[
'disc'
]);
$g_house_data
[
'code'
]
=
implode
(
'##'
,
$code_arr
);
}
$g_house_data
[
'market_area'
]
=
$house_info_data
[
'business_area'
];
$g_house_data
[
'market_area'
]
=
$house_info_data
[
'business_area'
];
$g_house_data
[
'shop_area_start'
]
=
$house_info_data
[
'room_area'
];
$g_house_data
[
'shop_area_start'
]
=
$house_info_data
[
'room_area'
];
$g_house_data
[
'shop_area_end'
]
=
$house_info_data
[
'room_area2'
];
$g_house_data
[
'shop_area_end'
]
=
$house_info_data
[
'room_area2'
];
...
@@ -88,7 +94,6 @@ class TransferHouseInfo extends Controller
...
@@ -88,7 +94,6 @@ class TransferHouseInfo extends Controller
echo
$i
.
'-'
;
echo
$i
.
'-'
;
Db
::
table
(
'g_houses'
)
->
insert
(
$g_house_data
);
Db
::
table
(
'g_houses'
)
->
insert
(
$g_house_data
);
$g_house_data_ext
[
'house_id'
]
=
$house_info_data
[
'id'
];
$g_house_data_ext
[
'house_id'
]
=
$house_info_data
[
'id'
];
$g_house_data_ext
[
'fee_rule'
]
=
$house_info_data
[
'fee_rule'
];
$g_house_data_ext
[
'fee_rule'
]
=
$house_info_data
[
'fee_rule'
];
$g_house_data_ext
[
'internal_item_advantage'
]
=
$house_info_data
[
'sellingpoint'
];
$g_house_data_ext
[
'internal_item_advantage'
]
=
$house_info_data
[
'sellingpoint'
];
...
@@ -113,7 +118,7 @@ class TransferHouseInfo extends Controller
...
@@ -113,7 +118,7 @@ class TransferHouseInfo extends Controller
Db
::
table
(
'g_houses_to_agents'
)
->
insert
([
Db
::
table
(
'g_houses_to_agents'
)
->
insert
([
'houses_id'
=>
$house_info_data
[
'id'
],
'houses_id'
=>
$house_info_data
[
'id'
],
'agents_id'
=>
$v
,
'agents_id'
=>
$v
,
'type'
=>
1
'type'
=>
2
]);
]);
}
}
}
}
...
...
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