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
9b015dd0
Commit
9b015dd0
authored
Apr 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改商铺数据转移
parent
91e6d02f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
25 deletions
+32
-25
TransferHouseInfo.php
application/api/controller/TransferHouseInfo.php
+32
-25
No files found.
application/api/controller/TransferHouseInfo.php
View file @
9b015dd0
...
@@ -8,12 +8,8 @@
...
@@ -8,12 +8,8 @@
namespace
app\api\controller
;
namespace
app\api\controller
;
use
app\model\GHouses
;
use
app\model\GHousesExt
;
use
app\model\HouseInfos
;
use
think\Controller
;
use
think\Controller
;
use
think\Db
;
class
TransferHouseInfo
extends
Controller
class
TransferHouseInfo
extends
Controller
{
{
...
@@ -23,26 +19,25 @@ class TransferHouseInfo extends Controller
...
@@ -23,26 +19,25 @@ class TransferHouseInfo extends Controller
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
table
()
{
public
function
table
()
{
$house_info
=
new
HouseInfos
();
$num
=
Db
::
table
(
'houseinfos'
)
->
order
(
'id desc'
)
->
value
(
'id'
);
$g_house_info
=
new
GHouses
();
$g_house_info_ext
=
new
GHousesExt
();
$num
=
$house_info
->
count
();
for
(
$i
=
1
;
$i
<=
$num
;
$i
++
)
{
for
(
$i
=
1
;
$i
<=
$num
;
$i
++
)
{
$house_info_data
=
$house_info
->
alias
(
'a'
)
$house_info_data
=
Db
::
table
(
'houseinfos'
)
->
field
(
'*'
)
->
join
(
'houseInfo_exts b'
,
'a.id=b.house_id'
,
'left'
)
->
where
(
'id'
,
$i
)
->
where
(
'a.id'
,
$i
)
->
find
();
->
find
();
$house_info_data_ext
=
Db
::
table
(
'houseinfo_exts'
)
->
field
(
'*'
)
->
where
(
'house_id'
,
$i
)
->
find
();
if
(
empty
(
$house_info_data
))
{
if
(
empty
(
$house_info_data
))
{
continue
;
continue
;
}
}
$g_house_data
[
'id'
]
=
$house_info_data
[
'id'
];
$g_house_data
[
'id'
]
=
$house_info_data
[
'id'
];
$g_house_data
[
'internal_title'
]
=
$house_info_data
[
'title'
];
$g_house_data
[
'internal_title'
]
=
$house_info_data
[
'title'
];
$g_house_data
[
'external_title'
]
=
$house_info_data
[
'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
[
'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'
]
=
$house_info_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'
];
...
@@ -53,7 +48,7 @@ class TransferHouseInfo extends Controller
...
@@ -53,7 +48,7 @@ class TransferHouseInfo extends Controller
$g_house_data
[
'rent_type'
]
=
$house_info_data
[
'rent_type'
];
$g_house_data
[
'rent_type'
]
=
$house_info_data
[
'rent_type'
];
$g_house_data
[
'rent_price'
]
=
$house_info_data
[
'price'
];
$g_house_data
[
'rent_price'
]
=
$house_info_data
[
'price'
];
$g_house_data
[
'industry_type'
]
=
$house_info_data
[
'yetai'
];
$g_house_data
[
'industry_type'
]
=
$house_info_data
[
'yetai'
];
$g_house_data
[
'case_manager_phone'
]
=
$house_info_data
[
'title'
];
//
$g_house_data['case_manager_phone'] = $house_info_data['title'];
//状态 0待审批 1上架 2下架 3回收
//状态 0待审批 1上架 2下架 3回收
if
(
$g_house_data
[
'room_num_left'
]
==
0
)
{
if
(
$g_house_data
[
'room_num_left'
]
==
0
)
{
...
@@ -85,20 +80,20 @@ class TransferHouseInfo extends Controller
...
@@ -85,20 +80,20 @@ class TransferHouseInfo extends Controller
//是否独家0否1是
//是否独家0否1是
$g_house_data
[
'is_exclusive_type'
]
=
$house_info_data
[
'exclusive_type'
];
$g_house_data
[
'is_exclusive_type'
]
=
$house_info_data
[
'exclusive_type'
];
$g_house_data
[
'upload_id'
]
=
$house_info_data
[
'admin_id'
];
$g_house_data
[
'upload_id'
]
=
$house_info_data
[
'admin_id'
];
$g_house_data
[
'operation_id'
]
=
$house_info_data
[
'title'
];
//
$g_house_data['operation_id'] = $house_info_data['title'];
$g_house_data
[
'file_path'
]
=
$house_info_data
[
'file_path'
];
$g_house_data
[
'file_path'
]
=
$house_info_data
[
'file_path'
];
$g_house_data
[
'landmark'
]
=
$house_info_data
[
'landmark'
];
$g_house_data
[
'landmark'
]
=
$house_info_data
[
'landmark'
];
$g_house_data
[
'create_time'
]
=
$house_info_data
[
'created'
];
$g_house_data
[
'create_time'
]
=
$house_info_data
[
'created'
];
$g_house_data
[
'update_time'
]
=
$house_info_data
[
'modified'
];
$g_house_data
[
'update_time'
]
=
$house_info_data
[
'modified'
];
$g_house_info
->
insert
(
$g_house_data
)
;
echo
$i
.
'-'
;
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
[
'
id
'
];
$g_house_data_ext
[
'internal_item_advantage'
]
=
$house_info_data
[
'
sellingpoint
'
];
$g_house_data_ext
[
'external_item_advantage'
]
=
$house_info_data
[
'foreign_advantage'
];
$g_house_data_ext
[
'external_item_advantage'
]
=
$house_info_data
_ext
[
'foreign_advantage'
];
$g_house_data_ext
[
'tiny_brochure_url'
]
=
$house_info_data
[
'
id
'
];
$g_house_data_ext
[
'tiny_brochure_url'
]
=
$house_info_data
[
'
weilinks
'
];
$g_house_data_ext
[
'auditorium'
]
=
$house_info_data
[
'auditorium'
];
$g_house_data_ext
[
'auditorium'
]
=
$house_info_data
[
'auditorium'
];
$g_house_data_ext
[
'traffic'
]
=
$house_info_data
[
'traffic'
];
$g_house_data_ext
[
'traffic'
]
=
$house_info_data
[
'traffic'
];
$g_house_data_ext
[
'agent_start_time'
]
=
$house_info_data
[
'exclusive_start'
];
$g_house_data_ext
[
'agent_start_time'
]
=
$house_info_data
[
'exclusive_start'
];
...
@@ -106,13 +101,24 @@ class TransferHouseInfo extends Controller
...
@@ -106,13 +101,24 @@ class TransferHouseInfo extends Controller
$g_house_data_ext
[
'enter_num'
]
=
$house_info_data
[
'enter_num'
];
$g_house_data_ext
[
'enter_num'
]
=
$house_info_data
[
'enter_num'
];
$g_house_data_ext
[
'do_business_date'
]
=
$house_info_data
[
'business_date'
];
$g_house_data_ext
[
'do_business_date'
]
=
$house_info_data
[
'business_date'
];
$g_house_data_ext
[
'start_business_date'
]
=
$house_info_data
[
'start_business_date'
];
$g_house_data_ext
[
'start_business_date'
]
=
$house_info_data
[
'start_business_date'
];
$g_house_data_ext
[
'opening_date'
]
=
$house_info_data
[
'
id
'
];
$g_house_data_ext
[
'opening_date'
]
=
$house_info_data
[
'
opentime
'
];
$g_house_data_ext
[
'sign_rule'
]
=
$house_info_data
[
'singn_rule'
];
$g_house_data_ext
[
'sign_rule'
]
=
$house_info_data
[
'singn_rule'
];
$g_house_data_ext
[
'landlord_phone'
]
=
$house_info_data
[
'landlord_phone'
];
$g_house_data_ext
[
'landlord_phone'
]
=
$house_info_data
[
'landlord_phone'
];
$g_house_data_ext
[
'create_time'
]
=
$house_info_data
[
'created'
];
$g_house_data_ext
[
'update_time'
]
=
$house_info_data
[
'modified'
];
Db
::
table
(
'g_houses_ext'
)
->
insert
(
$g_house_data_ext
);
$g_house_info_ext
->
insert
(
$g_house_data_ext
);
if
(
!
empty
(
$house_info_data
[
'agent_id'
]))
{
$agent_id_arr
=
explode
(
','
,
$house_info_data
[
'agent_id'
]);
foreach
(
$agent_id_arr
as
$k
=>
$v
)
{
Db
::
table
(
'g_houses_to_agents'
)
->
insert
([
'houses_id'
=>
$house_info_data
[
'id'
],
'agents_id'
=>
$v
,
'type'
=>
1
]);
}
}
}
}
return
;
}
}
}
}
\ 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