Commit 0f5af84e authored by hujun's avatar hujun

address

parent 49305376
......@@ -56,12 +56,13 @@ class HouseService
{
$result = [];
$validate = new HouseValidate();
$check_address = 1;
if (empty($data['id'])) {
$check = $validate->scene('add')->check($data);
} elseif ($operation_type == 'exclusive') {
$check = $validate->scene('exclusive')->check($data);
$this->exclusiveFile($data, $data['id']);
$check_address = 0;
} else {
$check = $validate->scene('edit')->check($data);
}
......@@ -79,16 +80,18 @@ class HouseService
}
try {
$check_where['internal_address'] = trim($data['internal_address']);
if (!empty($data['id'])) {
$check_where['id'] = ['<>', $data['id']];
}
$num = $this->m_house->getHouseListTotal($check_where);
if ($check_address) {
$check_where['internal_address'] = trim($data['internal_address']);
if (!empty($data['id'])) {
$check_where['id'] = ['<>', $data['id']];
}
$num = $this->m_house->getHouseListTotal($check_where);
if ($num > 0) {
$result['status'] = 'fail';
$result['msg'] = '该商铺存在相同地址';
return $result;
if ($num > 0) {
$result['status'] = 'fail';
$result['msg'] = '该商铺存在相同地址';
return $result;
}
}
if (!empty($data['landlord_phone'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment