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
14b2c806
Commit
14b2c806
authored
Jun 02, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楼盘标签
parent
c739183f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
213 additions
and
12 deletions
+213
-12
Shop.php
application/api/controller/Shop.php
+74
-0
Basic.php
application/api/extend/Basic.php
+2
-1
OfficeRoom.php
application/index/controller/OfficeRoom.php
+7
-0
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+51
-4
OfficeService.php
application/index/service/OfficeService.php
+6
-6
OfficeGLabels.php
application/model/OfficeGLabels.php
+28
-0
OfficeGRoom.php
application/model/OfficeGRoom.php
+44
-1
route.php
application/route.php
+1
-0
No files found.
application/api/controller/Shop.php
View file @
14b2c806
...
@@ -20,6 +20,7 @@ use app\model\GHousesImgs;
...
@@ -20,6 +20,7 @@ use app\model\GHousesImgs;
use
app\model\GImageDepot
;
use
app\model\GImageDepot
;
use
app\model\GLabels
;
use
app\model\GLabels
;
use
app\model\OBargainModel
;
use
app\model\OBargainModel
;
use
app\model\OfficeGLabels
;
use
app\model\OMarchInModel
;
use
app\model\OMarchInModel
;
use
app\model\Regions
;
use
app\model\Regions
;
use
think\Log
;
use
think\Log
;
...
@@ -29,6 +30,7 @@ class Shop extends Basic
...
@@ -29,6 +30,7 @@ class Shop extends Basic
protected
$db
;
protected
$db
;
protected
$dbImg
;
protected
$dbImg
;
protected
$labels
;
protected
$labels
;
protected
$room_labels
;
protected
$attentionModel
;
protected
$attentionModel
;
private
$gHousesModel
;
private
$gHousesModel
;
...
@@ -42,6 +44,7 @@ class Shop extends Basic
...
@@ -42,6 +44,7 @@ class Shop extends Basic
$this
->
db
=
new
GHouses
();
$this
->
db
=
new
GHouses
();
$this
->
dbImg
=
new
GHousesImgs
();
$this
->
dbImg
=
new
GHousesImgs
();
$this
->
labels
=
new
GLabels
();
$this
->
labels
=
new
GLabels
();
$this
->
room_labels
=
new
OfficeGLabels
();
$this
->
attentionModel
=
new
AttentionModel
();
$this
->
attentionModel
=
new
AttentionModel
();
$this
->
gHousesModel
=
new
GHouses
();
$this
->
gHousesModel
=
new
GHouses
();
$this
->
gHousesImgModel
=
new
GHousesImgs
();
$this
->
gHousesImgModel
=
new
GHousesImgs
();
...
@@ -566,6 +569,77 @@ class Shop extends Basic
...
@@ -566,6 +569,77 @@ class Shop extends Basic
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
/**
* 搜索页搜索条件
* @return \think\Response
*/
public
function
filtrateConditionRoom
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
if
(
empty
(
$params
[
"city"
]))
{
return
$this
->
response
(
"101"
,
"参数错误"
);
}
$city
=
$params
[
"city"
];
$regions
=
new
Regions
();
$cityList
=
$regions
->
getRegionsByCity
(
$city
);
$i
=
$j
=
0
;
$result
[
"area"
][
$i
][
"city"
]
=
"全部"
;
$result
[
"area"
][
$i
][
"disc"
][]
=
"全部"
;
foreach
(
$cityList
as
$k
=>
$v
)
{
$i
++
;
if
(
!
empty
(
$v
[
"name"
]))
{
$result
[
"area"
][
$i
][
"city"
]
=
$v
[
"name"
];
$result
[
"area"
][
$i
][
"disc"
][]
=
"全"
.
$v
[
"name"
];
}
foreach
(
$v
[
"city"
]
as
$item
)
{
if
(
!
empty
(
$item
))
{
$result
[
"area"
][
$i
][
"disc"
][]
=
$item
;
}
}
if
(
$j
==
0
)
{
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'district'
]
=
"全"
.
$v
[
"name"
];
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'business'
][]
=
[
'id'
=>
0
,
'name'
=>
'全部'
];
}
foreach
(
$v
[
'business_district'
]
as
$item2
)
{
if
(
!
empty
(
$item2
))
{
$j
++
;
$result
[
"area"
][
$i
][
"business_district"
][
$j
]
=
$item2
;
}
}
break
;
//目前只有上海和杭州其余的先不显示
}
$result
[
'yetai'
]
=
array
(
'全部'
,
'商场美食'
,
'沿街餐饮'
,
'百货超市'
,
'服饰鞋包'
,
'亲子教育'
,
'休闲娱乐'
,
'办公'
,
'其他'
);
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
$result
[
'money'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'3万以上'
),
array
(
'id'
=>
'1'
,
'value'
=>
'1万-3万'
),
array
(
'id'
=>
'2'
,
'value'
=>
'1万以下'
));
//面积
$result
[
'acreage'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'30m²以内'
),
array
(
'id'
=>
'1'
,
'value'
=>
'30-60m²'
),
array
(
'id'
=>
'2'
,
'value'
=>
'60-100m²'
),
array
(
'id'
=>
'3'
,
'value'
=>
'100-300m²'
)
,
array
(
'id'
=>
'4'
,
'value'
=>
'300-500m²'
),
array
(
'id'
=>
'5'
,
'value'
=>
'500m²以上'
));
$result
[
'more'
][]
=
"全部"
;
$labelsResult
=
$this
->
room_labels
->
getLabels
();
if
(
count
(
$labelsResult
)
>
0
)
{
foreach
(
$labelsResult
as
$labelsKey
=>
$labelsVal
)
{
if
(
$labelsVal
[
'name'
])
{
$result
[
'more'
][]
=
$labelsVal
[
'name'
];
}
}
}
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
/**
/**
* 商铺列表进场统计
* 商铺列表进场统计
* @return \think\Response
* @return \think\Response
...
...
application/api/extend/Basic.php
View file @
14b2c806
...
@@ -70,7 +70,8 @@ class Basic extends Controller
...
@@ -70,7 +70,8 @@ class Basic extends Controller
"api/addSublet"
,
"api/addSublet"
,
"api/getSiteListApp"
,
"api/getSiteListApp"
,
"api/recordCallNumShare"
,
"api/recordCallNumShare"
,
"api/addUserCallAgentV2"
"api/addUserCallAgentV2"
,
"api/filtrateConditionRoom"
);
);
/**
/**
...
...
application/index/controller/OfficeRoom.php
View file @
14b2c806
...
@@ -115,4 +115,10 @@ class OfficeRoom extends Basic
...
@@ -115,4 +115,10 @@ class OfficeRoom extends Basic
return
$this
->
response
(
$code
,
$msg
,
$data
);
return
$this
->
response
(
$code
,
$msg
,
$data
);
}
}
public
function
getRoomList
()
{
}
}
}
\ No newline at end of file
application/index/service/OfficeRoomService.php
View file @
14b2c806
...
@@ -28,6 +28,7 @@ class OfficeRoomService
...
@@ -28,6 +28,7 @@ class OfficeRoomService
private
$push
;
private
$push
;
private
$agent
;
private
$agent
;
private
$agent_room
;
private
$agent_room
;
private
$landlord_phone
;
public
function
__construct
()
public
function
__construct
()
{
{
...
@@ -37,6 +38,7 @@ class OfficeRoomService
...
@@ -37,6 +38,7 @@ class OfficeRoomService
$this
->
push
=
new
PushMessageService
();
$this
->
push
=
new
PushMessageService
();
$this
->
agent
=
new
AAgents
();
$this
->
agent
=
new
AAgents
();
$this
->
agent_room
=
new
OfficeGRoomToAgent
();
$this
->
agent_room
=
new
OfficeGRoomToAgent
();
$this
->
landlord_phone
=
new
OfficeGLandlordPhone
();
}
}
/**
/**
...
@@ -493,11 +495,10 @@ class OfficeRoomService
...
@@ -493,11 +495,10 @@ class OfficeRoomService
* @throws \think\exception\PDOException
* @throws \think\exception\PDOException
*/
*/
public
function
landlordPhoneEditV2
(
array
$data
,
$house_id
)
{
public
function
landlordPhoneEditV2
(
array
$data
,
$house_id
)
{
$m_landlord
=
new
OfficeGLandlordPhone
();
$update_data
=
$insert_data
=
$new_phone
=
$del_phone
=
$edit_phone
=
[];
$update_data
=
$insert_data
=
$new_phone
=
$del_phone
=
$edit_phone
=
[];
$key
=
0
;
$key
=
0
;
$old_landlord
=
$
m_landlord
->
getColumn
(
'id,phone'
,
[
'house_id'
=>
$house_id
]);
$old_landlord
=
$
this
->
landlord_phone
->
getColumn
(
'id,phone'
,
[
'house_id'
=>
$house_id
]);
if
(
empty
(
$old_landlord
))
{
if
(
empty
(
$old_landlord
))
{
//新增
//新增
...
@@ -545,11 +546,11 @@ class OfficeRoomService
...
@@ -545,11 +546,11 @@ class OfficeRoomService
}
}
if
(
$update_data
)
{
if
(
$update_data
)
{
$
m_landlord
->
updateDataAll
(
$update_data
);
$
this
->
landlord_phone
->
updateDataAll
(
$update_data
);
}
}
if
(
$insert_data
)
{
if
(
$insert_data
)
{
$
m_landlord
->
insertData
(
$insert_data
);
$
this
->
landlord_phone
->
insertData
(
$insert_data
);
}
}
return
$edit_phone
;
return
$edit_phone
;
}
}
...
@@ -576,7 +577,53 @@ class OfficeRoomService
...
@@ -576,7 +577,53 @@ class OfficeRoomService
return
[
'status'
=>
200
,
'msg'
=>
'success'
,
'data'
=>
$result
];
return
[
'status'
=>
200
,
'msg'
=>
'success'
,
'data'
=>
$result
];
}
}
/**
* @param $params
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* User HuJun
* Date 19-6-2 下午2:26
*/
public
function
getRoomList
(
$params
)
{
$page_no
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$page_size
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
/*房东手机号搜索*/
if
(
$params
[
'landlord_phone'
]
!=
NULL
)
{
if
(
strlen
(
$params
[
'landlord_phone'
])
!=
11
)
{
return
$this
->
response
(
101
,
'房东手机不足11位'
);
}
$landlord_where
[
'phone'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'landlord_phone'
]
.
'%'
];
$landlord_where
[
'status'
]
=
0
;
$landlord_arr
=
$this
->
landlord_phone
->
getList
(
1
,
1000
,
''
,
'house_id'
,
$landlord_where
);
if
(
empty
(
$landlord_arr
))
{
$data
[
'data'
][
'list'
]
=
[];
$data
[
'data'
][
'total'
]
=
0
;
return
$this
->
response
(
200
,
''
,
$data
);
}
else
{
$landlord_house_id
=
[];
foreach
(
$landlord_arr
as
$k
=>
$v
)
{
$landlord_house_id
[]
=
$v
[
'house_id'
];
}
$landlord_str
=
implode
(
','
,
$landlord_house_id
);
$where
[]
=
[
'EXP'
,
"id in (
{
$landlord_str
}
)"
];
}
}
/*所在区*/
if
(
!
empty
(
$params
[
'disc'
]))
{
$where
[
'disc'
]
=
$params
[
'disc'
];
}
/*所在市*/
if
(
!
empty
(
$params
[
'city'
]))
{
$where
[
'city'
]
=
$params
[
'city'
];
}
$this
->
m_office_room
->
getRoomAgent
(
$page_no
,
$page_size
);
}
...
...
application/index/service/OfficeService.php
View file @
14b2c806
...
@@ -258,14 +258,14 @@ class OfficeService
...
@@ -258,14 +258,14 @@ class OfficeService
if
(
$is_total
)
{
if
(
$is_total
)
{
$result
[
'total'
]
=
$this
->
m_office
->
getTotal
(
$where
);
$result
[
'total'
]
=
$this
->
m_office
->
getTotal
(
$where
);
}
$m_business
=
new
GBusinessDistrict
();
$m_business
=
new
GBusinessDistrict
();
foreach
(
$data
as
$k
=>
$v
)
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
isset
(
$v
[
'business_district_id'
]))
{
if
(
isset
(
$v
[
'business_district_id'
]))
{
$data
[
$k
][
'business_name'
]
=
$m_business
->
getFieldOneValue
(
'name'
,
[
'id'
=>
$v
[
'business_district_id'
]]);
$data
[
$k
][
'business_name'
]
=
$m_business
->
getFieldOneValue
(
'name'
,
[
'id'
=>
$v
[
'business_district_id'
]]);
}
}
}
}
}
$result
[
'data'
]
=
$data
;
$result
[
'data'
]
=
$data
;
$result
[
'status'
]
=
'successful'
;
$result
[
'status'
]
=
'successful'
;
...
...
application/model/OfficeGLabels.php
0 → 100644
View file @
14b2c806
<?php
namespace
app\model
;
class
OfficeGLabels
extends
BaseModel
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'office_g_labels'
;
protected
$db
;
/**
* GLabels constructor.
*/
function
__construct
()
{
$this
->
db
=
Db
(
$this
->
table
);
}
public
function
getLabels
()
{
return
$data
=
$this
->
db
->
field
(
"id,name"
)
->
select
();
}
}
application/model/OfficeGRoom.php
View file @
14b2c806
...
@@ -173,6 +173,16 @@ class OfficeGRoom extends BaseModel
...
@@ -173,6 +173,16 @@ class OfficeGRoom extends BaseModel
$save_data
[
'shop_sign'
]
=
$data
[
'shop_sign'
];
$save_data
[
'shop_sign'
]
=
$data
[
'shop_sign'
];
}
}
//佣金规则
if
(
isset
(
$data
[
'fee_rule'
]))
{
$save_data
[
'fee_rule'
]
=
$data
[
'fee_rule'
];
}
//房东备注
if
(
isset
(
$data
[
'landlord_remark'
]))
{
$save_data
[
'landlord_remark'
]
=
$data
[
'landlord_remark'
];
}
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'
);
...
@@ -207,7 +217,16 @@ class OfficeGRoom extends BaseModel
...
@@ -207,7 +217,16 @@ class OfficeGRoom extends BaseModel
->
find
();
->
find
();
}
}
/**
* @param $field
* @param $params
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* User HuJun
* Date 19-6-2 下午1:57
*/
public
function
getOfficeRoomInfo
(
$field
,
$params
)
public
function
getOfficeRoomInfo
(
$field
,
$params
)
{
{
$result
=
$this
->
field
(
$field
)
$result
=
$this
->
field
(
$field
)
...
@@ -216,4 +235,28 @@ class OfficeGRoom extends BaseModel
...
@@ -216,4 +235,28 @@ class OfficeGRoom extends BaseModel
->
find
();
->
find
();
return
$result
;
return
$result
;
}
}
/**
* @param $page_no
* @param $page_size
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* User HuJun
* Date 19-6-2 下午1:57
*/
public
function
getRoomAgent
(
$page_no
,
$page_size
,
$field
,
$where
)
{
return
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'office_g_room_to_agent b'
,
'a.id = b.house_id'
,
'left'
)
->
join
(
'a_agents b'
,
'b.agent_id = b.id'
,
'left'
)
->
where
(
$where
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
select
();
}
}
}
application/route.php
View file @
14b2c806
...
@@ -533,6 +533,7 @@ Route::group('api', [
...
@@ -533,6 +533,7 @@ Route::group('api', [
'getShopList'
=>
[
'api/shop/getShopList'
,
[
'method'
=>
'get|post'
]],
'getShopList'
=>
[
'api/shop/getShopList'
,
[
'method'
=>
'get|post'
]],
'filtrateCondition'
=>
[
'api/shop/filtrateCondition'
,
[
'method'
=>
'get | post'
]],
'filtrateCondition'
=>
[
'api/shop/filtrateCondition'
,
[
'method'
=>
'get | post'
]],
'filtrateConditionV2'
=>
[
'api/shop/filtrateConditionV2'
,
[
'method'
=>
'get | post'
]],
'filtrateConditionV2'
=>
[
'api/shop/filtrateConditionV2'
,
[
'method'
=>
'get | post'
]],
'filtrateConditionRoom'
=>
[
'api/shop/filtrateConditionRoom'
,
[
'method'
=>
'get | post'
]],
'getShopDetail'
=>
[
'api/shop/getShopDetail'
,
[
'method'
=>
'get|post'
]],
'getShopDetail'
=>
[
'api/shop/getShopDetail'
,
[
'method'
=>
'get|post'
]],
'getMarchInList'
=>
[
'api/shop/getMarchInList'
,
[
'method'
=>
'get|post'
]],
'getMarchInList'
=>
[
'api/shop/getMarchInList'
,
[
'method'
=>
'get|post'
]],
...
...
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