Commit 9f3165dc authored by hujun's avatar hujun

字段修改记录

parent 1bdf8dd2
......@@ -80,6 +80,7 @@ class OfficeRoomService
if (empty($scene)) {
if (isset($data['id'])) {
$scene = 'edit';
$this->editChangeLog($data, $data['id'], $agent_id); //修改日志记录
} else {
$scene = 'add';
}
......@@ -1583,4 +1584,61 @@ class OfficeRoomService
}
return $result;
}
/**
* 楼盘房源相关字段日志记录
*
* @param $data
* @param $room_id
* @param $agent_id
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function editChangeLog($data, $room_id, $agent_id)
{
$field = 'mansion,room_number,floor,is_exclusive_type,area,is_rent';
$room_data = $this->m_office_room->getFindData($field, ['id' => $room_id]);
$remark = [];
if ($room_data['mansion'] != $data['mansion']) {
$remark[] = '楼号/栋/座由('.$room_data['mansion'].')修改为('.$data['mansion'].')';
}
if ($room_data['room_number'] != $data['room_number']) {
$remark[] = '门牌号由('.$room_data['room_number'].')修改为('.$data['room_number'].')';
}
if ($room_data['floor'] != $data['floor']) {
$remark[] = '所在楼层由('.$room_data['floor'].')修改为('.$data['floor'].')';
}
if ($room_data['is_exclusive_type'] != $data['is_exclusive_type']) {
//是否独家0否1是
if ($room_data['is_exclusive_type']) {
$remark[] = '是否独家改为是';
} else {
$remark[] = '是否独家改为否';
}
}
if ($room_data['area'] != $data['area']) {
$remark[] = '面积由('.$room_data['area'].')修改为('.$data['area'].')';
}
if ($room_data['is_rent'] != $data['is_rent']) {
//是否已租 0未租 1已租
if ($room_data['is_rent']) {
$remark[] = '是否已租改为已租';
} else {
$remark[] = '是否已租改为未租';
}
}
if (!empty($remark)) {
$m_operating = new OfficeGOperatingRecord();
$m_operating->record($agent_id, 2, $remark, $data['id']);
}
return ;
}
}
\ No newline at end of file
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