Commit 54db65fc authored by clone's avatar clone

Merge branch '0618-v3.3.2' of https://gitee.com/zwyjjc/tl_estate into 0618-v3.3.2

parents e0c0bfa8 e7589978
...@@ -90,6 +90,17 @@ class OfficeRoomService ...@@ -90,6 +90,17 @@ class OfficeRoomService
$result['msg'] = $this->validate->getError(); $result['msg'] = $this->validate->getError();
return $result; return $result;
} }
$where['b.city'] = $data['city'];
$where['a.floor'] = $data['floor'];
$where['a.mansion'] = $data['mansion'];
$num = $this->m_office_room->getRoomBuildingListCount($where);
if ($num > 0) {
$result['status'] = 'fail';
$result['msg'] = '该楼盘房源重盘';
return $result;
}
$status = $this->m_office->getFieldOneValue('status', ['id' => $data['building_id']]);//验证办公楼字典是否完整 $status = $this->m_office->getFieldOneValue('status', ['id' => $data['building_id']]);//验证办公楼字典是否完整
$is_alert = 0; $is_alert = 0;
if ($status != 1) { if ($status != 1) {
......
...@@ -116,10 +116,10 @@ class OfficeBuildingRoomValidate extends Validate ...@@ -116,10 +116,10 @@ class OfficeBuildingRoomValidate extends Validate
protected $scene = [ protected $scene = [
'add' => ['floor', 'room_number', 'is_rent', 'is_exclusive_type', 'price_total', 'price', 'slotting_fee', 'management_fee', 'add' => ['floor', 'room_number', 'is_rent', 'is_exclusive_type', 'price_total', 'price', 'slotting_fee', 'management_fee',
'station_start', 'station_end', 'area', 'floor_tag', 'enter_time', 'payment_month', 'deposit_month', 'age_limit_start', 'station_start', 'station_end', 'area', 'floor_tag', 'enter_time', 'payment_month', 'deposit_month', 'age_limit_start',
'age_limit_end', 'is_partition', 'carport', 'rent_free', 'source', 'decoration', 'shop_sign'], 'age_limit_end', 'is_partition', 'carport', 'rent_free', 'source', 'decoration', 'shop_sign','mansion'],
'edit' => ['id', 'floor', 'room_number', 'is_rent', 'is_exclusive_type', 'price_total', 'price', 'slotting_fee', 'management_fee', 'edit' => ['id', 'floor', 'room_number', 'is_rent', 'is_exclusive_type', 'price_total', 'price', 'slotting_fee', 'management_fee',
'station_start', 'station_end', 'area', 'floor_tag', 'enter_time', 'payment_month', 'deposit_month', 'age_limit_start', 'station_start', 'station_end', 'area', 'floor_tag', 'enter_time', 'payment_month', 'deposit_month', 'age_limit_start',
'age_limit_end', 'is_partition', 'carport', 'rent_free', 'source', 'decoration', 'shop_sign'], 'age_limit_end', 'is_partition', 'carport', 'rent_free', 'source', 'decoration', 'shop_sign','mansion'],
'detail' => ['id'], 'detail' => ['id'],
'is_carefully_chosen' => ['id', 'is_carefully_chosen'], 'is_carefully_chosen' => ['id', 'is_carefully_chosen'],
'exclusive' => ['agent_start_time,agent_end_time,is_exclusive_type,id'], 'exclusive' => ['agent_start_time,agent_end_time,is_exclusive_type,id'],
......
...@@ -479,6 +479,18 @@ class OfficeGRoom extends BaseModel ...@@ -479,6 +479,18 @@ class OfficeGRoom extends BaseModel
->select(); ->select();
} }
/**
* @param $params
* @return int|string
*/
function getRoomBuildingListCount($params)
{
return $data = $this->alias("a")
->join("office_g_building b", "a.building_id=b.id", "left")
->where($params)
->count('a.id');
}
/** /**
* @param $field * @param $field
* @param $params * @param $params
......
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