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
a24b427c
Commit
a24b427c
authored
May 30, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all
parent
b1dba3b5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
372 additions
and
41 deletions
+372
-41
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+0
-0
OfficeBuildingRoomValidate.php
application/index/validate/OfficeBuildingRoomValidate.php
+78
-39
OfficeBuildingValidate.php
application/index/validate/OfficeBuildingValidate.php
+1
-1
OfficeGLandlordPhone.php
application/model/OfficeGLandlordPhone.php
+95
-0
OfficeGOperatingRecord.php
application/model/OfficeGOperatingRecord.php
+119
-0
OfficeGRoom.php
application/model/OfficeGRoom.php
+0
-1
OfficeGRoomToAgent.php
application/model/OfficeGRoomToAgent.php
+79
-0
No files found.
application/index/service/OfficeRoomService.php
View file @
a24b427c
This diff is collapsed.
Click to expand it.
application/index/validate/OfficeBuildingRoomValidate.php
View file @
a24b427c
...
@@ -15,51 +15,89 @@ class OfficeBuildingRoomValidate extends Validate
...
@@ -15,51 +15,89 @@ class OfficeBuildingRoomValidate extends Validate
{
{
protected
$rule
=
[
protected
$rule
=
[
'id'
=>
'require|between: 1,99999999999'
,
'id'
=>
'require|between: 1,99999999999'
,
'upload_id'
=>
'require|between: 1,99999999999'
,
'floor'
=>
'require|between: 1,99999'
,
'title'
=>
'require|length:1,125'
,
'room_number'
=>
'require|length:1,50'
,
'address'
=>
'require|length:1,125'
,
'is_rent'
=>
'require|in:0,1'
,
'province'
=>
'require|length:1,60'
,
'is_exclusive_type'
=>
'require|in:0,1'
,
'city'
=>
'require|length:1,60'
,
'price_total'
=>
'require|between: 1,99999999'
,
'disc'
=>
'require|length:1,60'
,
'price'
=>
'require|between: 1,99999999'
,
'type'
=>
'require'
,
'slotting_fee'
=>
'require|between: 1,99999999'
,
'status'
=>
'require|in:[0,1,2]'
,
'management_fee'
=>
'require|between: 1,99999999'
,
'floor_total'
=>
'require|between:0,9999999999'
,
'station_start'
=>
'require|between: 1,99999'
,
'longitude'
=>
'require|min:1'
,
'station_end'
=>
'require|between: 1,99999'
,
'latitude'
=>
'require|min:1'
,
'area'
=>
'require|between: 1,99999'
,
'business_district_id'
=>
'require|between: 1,99999999999'
,
'floor_tag'
=>
'require|in:1,2,3'
,
'intro'
=>
'require|length:1,255'
'enter_time'
=>
'require'
,
'payment_month'
=>
'require|between:1,12'
,
'deposit_month'
=>
'require|between:1,12'
,
'age_limit_start'
=>
'require|between:1,12'
,
'age_limit_end'
=>
'require|between:1,12'
,
'is_partition'
=>
'is_partition|in:0,1'
,
'carport'
=>
'require|length:1,255'
,
'rent_free'
=>
'require|length:-1,99'
,
'source'
=>
'require|in:0,1,2,3,4,5,6,7'
,
'is_show'
=>
'require|in:0,1'
,
'decoration'
=>
'require|in:1,2,3,4'
,
'shop_sign'
=>
'require|length:1,255'
,
];
];
protected
$message
=
[
protected
$message
=
[
'title.require'
=>
'对内楼盘名为必填'
,
'floor.require'
=>
'所在楼层必填'
,
'title.length'
=>
'名称字数在1至125个字'
,
'floor.between'
=>
'所在楼层参数错误'
,
'address.require'
=>
'楼盘地址为必填'
,
'room_number.require'
=>
'门牌号为必填'
,
'address.length'
=>
'地址要在1至255个字'
,
'room_number.length'
=>
'门牌号要在1至50个字'
,
'province.require'
=>
'省份为必填'
,
'is_rent.require'
=>
'房源状态必选'
,
'province.length'
=>
'省份要在1至60个字'
,
'is_rent.in'
=>
'房源状态参数错误'
,
'city.require'
=>
'市为必填'
,
'is_exclusive_type.require'
=>
'是否独家必选'
,
'city.length'
=>
'对内地址要在1至60个字'
,
'is_exclusive_type.in'
=>
'是否独家参数错误'
,
'disc.require'
=>
'区为必填'
,
'price_total.require'
=>
'租金总价必填'
,
'disc.length'
=>
'对内地址要在1至60个字'
,
'price_total.between'
=>
'租金总价必填'
,
'longitude.require'
=>
'无法获取楼盘坐标,请重新修改地址'
,
'price.require'
=>
'租金单价必填'
,
'longitude.min'
=>
'楼盘坐标参数错误'
,
'price.between'
=>
'租金单价参数错误'
,
'latitude.require'
=>
'无法获取楼盘坐标,请重新修改地址'
,
'slotting_fee.require'
=>
'转让费必填'
,
'latitude.min'
=>
'楼盘坐标参数错误'
,
'slotting_fee.between'
=>
'转让费参数错误'
,
'business_district_id.require'
=>
'楼盘必选'
,
'management_fee.require'
=>
'物业管理费必填'
,
'business_district_id.between'
=>
'楼盘参数错误'
,
'management_fee.between'
=>
'物业管理费参数错误'
,
'id.require'
=>
'楼盘id必传'
,
'station_start.require'
=>
'可容纳工位开始必填'
,
'id.between'
=>
'楼盘id错误'
,
'station_start.between'
=>
'可容纳工位开始参数错误'
,
'upload_id.require'
=>
'上传人id必传'
,
'station_end.require'
=>
'可容纳工位结束必填'
,
'upload_id.between'
=>
'上传人id错误'
,
'station_end.between'
=>
'可容纳工位结束参数错误'
,
'intro.require'
=>
'楼盘简介必填'
,
'area.require'
=>
'可面积必填'
,
'intro.length'
=>
'楼盘简介要做1至255个字'
'area.between'
=>
'面积参数错误'
,
'floor_tag.require'
=>
'所属楼层必填'
,
'floor_tag.in'
=>
'所属楼层参数错误'
,
'enter_time.require'
=>
'入住时间必填'
,
'payment_month.require'
=>
'付款规则开始必填'
,
'payment_month.between'
=>
'付款规则开始参数错误'
,
'deposit_month.require'
=>
'付款规则结束必填'
,
'deposit_month.between'
=>
'付款规则结束参数错误'
,
'age_limit_start.require'
=>
'签约年限开始必填'
,
'age_limit_start.between'
=>
'签约年限开始参数错误'
,
'age_limit_end.require'
=>
'签约年限结束必填'
,
'age_limit_end.between'
=>
'签约年限结束参数错误'
,
'is_partition.require'
=>
'是否可分割必填'
,
'is_partition.in'
=>
'是否可分割参数错误'
,
'carport.require'
=>
'车位请况为必填'
,
'carport.length'
=>
'车位请况要在1至255个字'
,
'rent_free.require'
=>
'免租时间为必填'
,
'rent_free.length'
=>
'免租时间要在1至99个字'
,
'source.require'
=>
'来源为必填'
,
'source.length'
=>
'来源参数错误'
,
'is_show.require'
=>
'是否对客户展示必填'
,
'is_show.between'
=>
'是否对客户展示参数错误'
,
'decoration.require'
=>
'交付装修必填'
,
'decoration.between'
=>
'交付装修参数错误'
,
'shop_sign.require'
=>
'商铺标签为必填'
,
'shop_sign.length'
=>
'商铺标签参数错误'
,
];
];
protected
$scene
=
[
protected
$scene
=
[
'add'
=>
[
'title'
,
'address'
,
'province'
,
'city'
,
'disc'
,
'type'
,
'floor_total'
,
'longitude'
,
'latitude'
,
'add'
=>
[
'floor'
,
'room_number'
,
'is_rent'
,
'is_exclusive_type'
,
'price_total'
,
'price'
,
'slotting_fee'
,
'management_fee'
,
'business_district_id'
,
'upload_id'
,
'intro'
],
'station_start'
,
'station_end'
,
'area'
,
'floor_tag'
,
'enter_time'
,
'payment_month'
,
'deposit_month'
,
'age_limit_start'
,
'edit'
=>
[
'id'
,
'title'
,
'address'
,
'province'
,
'city'
,
'disc'
,
'type'
,
'floor_total'
,
'longitude'
,
'latitude'
,
'age_limit_end'
,
'is_partition'
,
'carport'
,
'rent_free'
,
'source'
,
'is_show'
,
'decoration'
,
'shop_sign'
],
'business_district_id'
,
'intro'
],
'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'
,
'is_show'
,
'decoration'
,
'shop_sign'
],
'detail'
=>
[
'id'
]
'detail'
=>
[
'id'
]
];
];
}
}
\ No newline at end of file
application/index/validate/OfficeBuildingValidate.php
View file @
a24b427c
...
@@ -22,7 +22,7 @@ class OfficeBuildingValidate extends Validate
...
@@ -22,7 +22,7 @@ class OfficeBuildingValidate extends Validate
'city'
=>
'require|length:1,60'
,
'city'
=>
'require|length:1,60'
,
'disc'
=>
'require|length:1,60'
,
'disc'
=>
'require|length:1,60'
,
'type'
=>
'require'
,
'type'
=>
'require'
,
'status'
=>
'require|in:
[0,1,2]
'
,
'status'
=>
'require|in:
0,1,2
'
,
'floor_total'
=>
'require|between:0,9999999999'
,
'floor_total'
=>
'require|between:0,9999999999'
,
'longitude'
=>
'require|min:1'
,
'longitude'
=>
'require|min:1'
,
'latitude'
=>
'require|min:1'
,
'latitude'
=>
'require|min:1'
,
...
...
application/model/OfficeGLandlordPhone.php
0 → 100644
View file @
a24b427c
<?php
namespace
app\model
;
use
think\Db
;
class
OfficeGLandlordPhone
extends
BaseModel
{
protected
$table
=
'office_g_landlord_phone'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* @param $name
* @param $room_id
* @param $phone
* @param $id
* @return bool|int
* User HuJun
* Date 19-5-30 下午9:04
*/
public
function
add
(
$name
,
$room_id
,
$phone
,
$id
=
0
)
{
$save_data
=
[];
if
(
empty
(
$name
))
{
return
false
;
}
if
(
empty
(
$room_id
))
{
return
false
;
}
if
(
empty
(
$phone
))
{
return
false
;
}
$save_data
[
'name'
]
=
$name
;
$save_data
[
'room_id'
]
=
$room_id
;
$save_data
[
'phone'
]
=
$phone
;
if
(
$id
)
{
$save_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$id
=
$this
->
insertGetId
(
$save_data
);
}
else
{
try
{
$save_data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
);
$this
->
where
(
'id'
,
$id
)
->
update
(
$save_data
);
$id
=
$id
;
}
catch
(
\Exception
$e
)
{
$id
=
0
;
}
}
return
(
int
)
$id
;
}
/**
* @param $data
* @param $where
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
* User HuJun
* Date 19-5-30 下午8:49
*/
public
function
updateData
(
$data
,
$where
)
{
return
$this
->
db_
->
where
(
$where
)
->
update
(
$data
);
}
/**
* @param $data
* @return int|string
*/
public
function
insertData
(
$data
){
return
$this
->
db_
->
insertAll
(
$data
);
}
/**
* @param $field
* @param $where
* @return array
*/
public
function
getColumn
(
$field
,
$where
)
{
return
$this
->
db_
->
where
(
$where
)
->
column
(
$field
);
}
}
application/model/OfficeGOperatingRecord.php
0 → 100644
View file @
a24b427c
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/1/20
* Time: 17:52
*/
namespace
app\model
;
use
think\Request
;
use
think\Session
;
class
OfficeGOperatingRecord
extends
BaseModel
{
/**
* 日志
*
* @param int $agents_id
* @param string $type
* @param string $remark
* @param string $room_id
* @param int $user_id
* @return bool|false|int
* User HuJun
* Date 19-5-30 下午8:44
*/
public
function
record
(
$agents_id
=
0
,
$type
=
''
,
$remark
=
''
,
$room_id
=
''
,
$user_id
=
0
)
{
$result
=
false
;
$agents_id
=
$agents_id
?
$agents_id
:
Session
::
get
(
'userId'
);
if
(
$agents_id
>
0
)
{
$request
=
Request
::
instance
();
$name
=
Session
::
get
(
'userName'
);
if
(
empty
(
$name
))
{
$name
=
db
(
'a_agents'
)
->
where
(
'id'
,
$agents_id
)
->
value
(
'name'
);
}
$data
=
[
'agents_id'
=>
$agents_id
,
'name'
=>
$name
,
'url'
=>
$request
->
url
(),
'ip'
=>
$request
->
ip
(),
'remark'
=>
$remark
,
'room_id'
=>
$room_id
,
'user_id'
=>
$user_id
,
'type'
=>
$type
,
'create_time'
=>
date
(
'Y-m-d H:i:s'
),
];
$result
=
$this
->
isUpdate
(
false
)
->
data
(
$data
)
->
save
();
}
return
$result
;
}
/**
* @param $param
* @return array|false|\PDOStatement|string|\think\Collection
* User HuJun
* Date 19-5-30 下午8:44
*/
public
function
user_history
(
$param
)
{
if
(
empty
(
$param
[
'user_id'
]))
{
return
[];
}
try
{
$data
=
$this
->
field
(
'name,remark,create_time,user_id'
)
->
where
(
$param
)
->
order
(
'create_time'
,
'desc'
)
->
select
();
}
catch
(
\Exception
$e
)
{
$data
=
[];
}
return
$data
;
}
/**
* @param $pageNo
* @param $pageSize
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* User HuJun
* Date 19-5-30 下午8:44
*/
public
function
getRecordsList
(
$pageNo
,
$pageSize
,
$field
,
$params
)
{
$order
=
"OperatingRecords.create_time desc"
;
return
$this
->
field
(
$field
)
->
alias
(
'OperatingRecords'
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order
)
->
select
();
}
/**
* @param $field
* @param $params
* @return int|string
* User HuJun
* Date 19-5-30 下午8:44
*/
public
function
getRecordsListTotal
(
$field
,
$params
)
{
return
$this
->
field
(
$field
)
->
alias
(
'OperatingRecords'
)
->
where
(
$params
)
->
count
();
}
}
\ No newline at end of file
application/model/OfficeGRoom.php
View file @
a24b427c
...
@@ -168,7 +168,6 @@ class OfficeGRoom extends BaseModel
...
@@ -168,7 +168,6 @@ class OfficeGRoom extends BaseModel
$save_data
[
'shop_sign'
]
=
$data
[
'shop_sign'
];
$save_data
[
'shop_sign'
]
=
$data
[
'shop_sign'
];
}
}
if
(
empty
(
$data
[
'id'
]))
{
if
(
empty
(
$data
[
'id'
]))
{
$save_data
[
'operation_id'
]
=
$agent_id
;
//上传人
$save_data
[
'operation_id'
]
=
$agent_id
;
//上传人
$save_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$save_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
...
...
application/model/OfficeGRoomToAgent.php
0 → 100644
View file @
a24b427c
<?php
namespace
app\model
;
use
think\Db
;
class
OfficeGRoomToAgent
extends
BaseModel
{
protected
$table
=
'office_g_room_to_agent'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* 新增和编辑办公楼与经纪人关系
*
* @param array $data
* @return int|mixed|string
*/
public
function
add
(
array
$data
)
{
$save_data
=
[];
if
(
isset
(
$data
[
'agent_id'
]))
{
$save_data
[
'agent_id'
]
=
(
int
)
$data
[
'agent_id'
];
}
if
(
isset
(
$data
[
'room_id'
]))
{
$save_data
[
'room_id'
]
=
(
int
)
$data
[
'room_id'
];
}
if
(
isset
(
$data
[
'room_id'
]))
{
$save_data
[
'room_id'
]
=
(
int
)
$data
[
'room_id'
];
}
if
(
empty
(
$data
[
'id'
]))
{
$save_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$room_id
=
$this
->
insertGetId
(
$save_data
);
}
else
{
try
{
$save_data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
);
$this
->
where
(
'id'
,
$data
[
'id'
])
->
update
(
$save_data
);
$room_id
=
$data
[
'id'
];
}
catch
(
\Exception
$e
)
{
$room_id
=
0
;
}
}
return
(
int
)
$room_id
;
}
/**
* @param $data
* @param $where
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
* User HuJun
* Date 19-5-30 下午8:49
*/
public
function
updateData
(
$data
,
$where
)
{
return
$this
->
db_
->
where
(
$where
)
->
update
(
$data
);
}
/**
* @param $data
* @return int|string
*/
public
function
insertData
(
$data
){
return
$this
->
db_
->
insertAll
(
$data
);
}
}
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