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
616b73b4
Commit
616b73b4
authored
Apr 02, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
房东手机号修改记录
parent
4a41b079
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
101 additions
and
16 deletions
+101
-16
HouseService.php
application/index/service/HouseService.php
+91
-16
GLandlordPhone.php
application/model/GLandlordPhone.php
+10
-0
No files found.
application/index/service/HouseService.php
View file @
616b73b4
...
@@ -105,7 +105,7 @@ class HouseService
...
@@ -105,7 +105,7 @@ class HouseService
}
}
if
(
!
empty
(
$data
[
'id'
]))
{
if
(
!
empty
(
$data
[
'id'
]))
{
$house_data
=
$this
->
m_house
->
getHouseInfo
(
'id,internal_address,internal_title'
,
[
'id'
=>
$data
[
'id'
]]);
$house_data
=
$this
->
m_house
->
getHouseInfo
(
'id,internal_address,internal_title
,shop_area_start
'
,
[
'id'
=>
$data
[
'id'
]]);
if
(
empty
(
$house_data
[
0
][
'id'
]))
{
if
(
empty
(
$house_data
[
0
][
'id'
]))
{
$result
[
'status'
]
=
'fail'
;
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
'没有该商铺信息'
;
$result
[
'msg'
]
=
'没有该商铺信息'
;
...
@@ -131,15 +131,19 @@ class HouseService
...
@@ -131,15 +131,19 @@ class HouseService
}
}
if
(
!
empty
(
$landlord_phone_new
))
{
if
(
!
empty
(
$landlord_phone_new
))
{
$landlord_phone_old
=
$this
->
landlordPhoneEdit
(
$landlord_phone_new
,
$data
[
'id'
]);
$landlord_phone_old
=
$this
->
landlordPhoneEdit
V2
(
$landlord_phone_new
,
$data
[
'id'
]);
if
(
!
empty
(
$landlord_phone_old
))
{
if
(
!
empty
(
$landlord_phone_old
))
{
$remark
.=
',删除房东手机号:'
.
implode
(
','
,
$landlord_phone_old
);
$remark
.=
implode
(
','
,
$landlord_phone_old
);
}
}
}
}
if
(
!
empty
(
$data
[
'shop_area_start'
])
&&
$data
[
'shop_area_start'
]
!=
$house_data
[
0
][
'shop_area_start'
])
{
$remark
.=
',街铺面积:'
.
$house_data
[
0
][
'shop_area_start'
]
.
'修改为'
.
$data
[
'shop_area_start'
];
}
var_dump
(
$landlord_phone_old
);
die
;
$m_operating
->
record
(
$agent_id
,
6
,
$remark
,
$data
[
'id'
]);
$m_operating
->
record
(
$agent_id
,
6
,
$remark
,
$data
[
'id'
]);
die
(
'11111'
);
if
(
empty
(
$data
[
'is_exclusive_type'
]))
{
if
(
empty
(
$data
[
'is_exclusive_type'
]))
{
$this
->
delAgentHouse
(
3
,
$data
[
'id'
],
0
);
$this
->
delAgentHouse
(
3
,
$data
[
'id'
],
0
);
unset
(
$data
[
'exclusive_ids'
]);
unset
(
$data
[
'exclusive_ids'
]);
...
@@ -224,18 +228,6 @@ class HouseService
...
@@ -224,18 +228,6 @@ class HouseService
}
}
}
}
// if (empty($data['id'])) {
// $house_img->add($data, $house_id); //只记录新增图片
// } else {
// $image_result = $house_img->edit($data, $house_id); //编辑图片
//
// if ($image_result['status'] == 'fail') {
// $result['status'] = 'fail';
// $result['msg'] = '编辑图片失败,' . $validate->getError();
// return $result;
// }
// }
//案场权限人
//案场权限人
if
(
!
empty
(
$data
[
'agent_data'
]))
{
if
(
!
empty
(
$data
[
'agent_data'
]))
{
$result_agent_data
=
$this
->
releaseRelationshipV2
(
$data
[
'agent_data'
],
$house_id
,
1
,
$agent_id
,
$data
[
'internal_title'
],
$site_id
);
$result_agent_data
=
$this
->
releaseRelationshipV2
(
$data
[
'agent_data'
],
$house_id
,
1
,
$agent_id
,
$data
[
'internal_title'
],
$site_id
);
...
@@ -691,6 +683,89 @@ class HouseService
...
@@ -691,6 +683,89 @@ class HouseService
return
$del_phone
;
return
$del_phone
;
}
}
/**
* 房东手机号处理
*
* @param array $data
* @param $house_id
* @return array 删除的手机号
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public
function
landlordPhoneEditV2
(
array
$data
,
$house_id
)
{
$m_landlord
=
new
GLandlordPhone
();
$update_data
=
$insert_data
=
$new_phone
=
$del_phone
=
$edit_phone
=
[];
$key
=
0
;
$old_landlord
=
$m_landlord
->
getColumn
(
'id,phone'
,
[
'house_id'
=>
$house_id
,
'status'
=>
0
]);
if
(
empty
(
$old_landlord
))
{
//新增
foreach
(
$data
as
$k
=>
$v
)
{
$insert_data
[
$k
][
'name'
]
=
$v
[
'name'
];
$insert_data
[
$k
][
'phone'
]
=
$v
[
'phone'
];
$insert_data
[
$k
][
'house_id'
]
=
$house_id
;
$edit_phone
[]
=
'新增房东手机号:'
.
substr_replace
(
$v
[
'phone'
],
'****'
,
3
,
4
);
}
}
else
{
//新增与编辑
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$v
[
'id'
])
{
$phone
=
$old_landlord
[
$v
[
'id'
]];
$update_data
[
$key
][
'id'
]
=
$v
[
'id'
];
$update_data
[
$key
][
'name'
]
=
$v
[
'name'
];
if
(
$phone
!=
$v
[
'phone'
])
{
$update_data
[
$k
][
'phone'
]
=
$v
[
'phone'
];
$edit_phone
[]
=
substr_replace
(
$phone
,
'****'
,
3
,
4
)
.
'修改为;'
.
substr_replace
(
$v
[
'phone'
],
'****'
,
3
,
4
);
$new_phone
[]
=
$phone
;
}
}
else
{
//v3.2.1 之后去除update_data
$id
=
array_search
(
$v
[
'phone'
],
$old_landlord
);
if
(
$id
)
{
$update_data
[
$key
][
'id'
]
=
$id
;
$update_data
[
$key
][
'phone'
]
=
$v
[
'phone'
];
$update_data
[
$key
][
'house_id'
]
=
$house_id
;
$update_data
[
$key
][
'name'
]
=
$v
[
'name'
];
$phone
=
$old_landlord
[
$v
[
'id'
]];
if
(
$phone
!=
$v
[
'phone'
])
{
$update_data
[
$k
][
'phone'
]
=
$v
[
'phone'
];
$edit_phone
[]
=
substr_replace
(
$phone
,
'****'
,
3
,
4
)
.
'修改为;'
.
substr_replace
(
$v
[
'phone'
],
'****'
,
3
,
4
);
$new_phone
[]
=
$phone
;
$new_phone
[]
=
$old_landlord
[
$v
[
'id'
]];
}
}
else
{
$insert_data
[
$key
][
'phone'
]
=
$v
[
'phone'
];
$insert_data
[
$key
][
'house_id'
]
=
$house_id
;
$insert_data
[
$key
][
'name'
]
=
$v
[
'name'
];
$new_phone
[]
=
$old_landlord
[
$v
[
'id'
]];
}
}
$new_phone
[]
=
$v
[
'phone'
];
$key
++
;
}
foreach
(
$old_landlord
as
$k2
=>
$v2
)
{
if
(
!
in_array
(
$v2
,
$new_phone
))
{
$update_data
[
$key
][
'id'
]
=
$k2
;
$update_data
[
$key
][
'status'
]
=
1
;
$key
++
;
$edit_phone
[]
=
'删除房东手机号:'
.
substr_replace
(
$v2
,
'****'
,
3
,
4
)
;
}
}
}
if
(
$update_data
)
{
$m_landlord
->
updateData
(
$update_data
);
}
if
(
$insert_data
)
{
$m_landlord
->
insertData
(
$insert_data
);
}
return
$edit_phone
;
}
/**
/**
* 获取商铺信息
* 获取商铺信息
*
*
...
...
application/model/GLandlordPhone.php
View file @
616b73b4
...
@@ -61,6 +61,16 @@ class GLandlordPhone extends BaseModel
...
@@ -61,6 +61,16 @@ class GLandlordPhone extends BaseModel
->
column
(
$field
);
->
column
(
$field
);
}
}
/**
* @param $field
* @param $where
* @return array
*/
public
function
getValue
(
$field
,
$where
)
{
return
$this
->
db_
->
where
(
$where
)
->
value
(
$field
);
}
/**
/**
* @param $data
* @param $data
* @return int|string
* @return int|string
...
...
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