Commit e7589978 authored by hujun's avatar hujun

检查重盘

parent 9c8cc4e2
......@@ -90,6 +90,17 @@ class OfficeRoomService
$result['msg'] = $this->validate->getError();
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']]);//验证办公楼字典是否完整
$is_alert = 0;
if ($status != 1) {
......
......@@ -116,10 +116,10 @@ class OfficeBuildingRoomValidate extends Validate
protected $scene = [
'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',
'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',
'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'],
'is_carefully_chosen' => ['id', 'is_carefully_chosen'],
'exclusive' => ['agent_start_time,agent_end_time,is_exclusive_type,id'],
......
......@@ -477,6 +477,18 @@ class OfficeGRoom extends BaseModel
->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 $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