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
baa88081
Commit
baa88081
authored
Aug 07, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
城市选择
parent
e3f3a8e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
28 deletions
+36
-28
Location.php
application/api_broker/controller/Location.php
+13
-6
Shop.php
application/api_broker/controller/Shop.php
+23
-22
No files found.
application/api_broker/controller/Location.php
View file @
baa88081
...
...
@@ -27,11 +27,11 @@ class Location extends Basic
public
function
saveSiteCity
()
{
$params
=
$this
->
params
;
/*
$params = array(
"agent_id" => 1,
"city" => "上海"
);*/
$params
=
$this
->
params
;
$params
=
array
(
"agent_id"
=>
1
,
"city"
=>
"上海"
);
$checkResult
=
$this
->
validate
(
$params
,
"LocationValidate.saveSiteCityVerify"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
...
...
@@ -41,7 +41,13 @@ class Location extends Basic
if
(
$params
[
"city"
]
==
"杭州"
)
{
$city
=
"杭州"
;
}
$this
->
redis_
->
set
(
self
::
CITY_AGENTS
.
$agent_id
,
$city
);
if
(
$this
->
redis_
)
{
$this
->
redis_
->
set
(
self
::
CITY_AGENTS
.
$agent_id
,
$city
);
}
else
{
return
$this
->
response
(
"101"
,
"redis service not found"
);
}
return
$this
->
response
(
"200"
,
"success"
,
[]);
}
}
\ No newline at end of file
application/api_broker/controller/Shop.php
View file @
baa88081
...
...
@@ -86,6 +86,7 @@ class Shop extends Basic
$field
=
"id,internal_title as title,internal_address as address,city,disc,business_district_id,status,industry_type
,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price"
;
$conditions
[
"city"
]
=
trim
(
$this
->
city
);
}
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
...
...
@@ -275,7 +276,7 @@ class Shop extends Basic
$conditions
[
'a.id'
]
=
array
(
"eq"
,
$params
[
"id"
]
);
$field
.=
',b.age_limit,b.payment_month,b.deposit_month,b.external_slotting_fee'
;
$field
.=
',b.age_limit,b.payment_month,b.deposit_month,b.external_slotting_fee'
;
$result
=
$this
->
gHousesModel
->
getHouseDetailById
(
$field
,
$conditions
);
if
(
count
(
$result
)
<=
0
)
{
return
$this
->
response
(
"101"
,
'此楼盘不存在'
);
...
...
@@ -297,8 +298,8 @@ class Shop extends Basic
if
(
$result
[
"external_slotting_fee"
]
!=
'-1'
)
{
$result
[
"external_slotting_fee"
]
=
$result
[
"external_slotting_fee"
]
*
0.01
;
}
$result
[
"api_path"
]
=
CK_IMG_URL
.
'images/'
;
$param
[
"house_id"
]
=
$params
[
'id'
];
$result
[
"api_path"
]
=
CK_IMG_URL
.
'images/'
;
$param
[
"house_id"
]
=
$params
[
'id'
];
//todo 这里的是否要更改成b端后台上传的类型
$param
[
"img_type"
]
=
2
;
$result
[
"images"
]
=
$this
->
gHousesImgModel
->
getHouseImages
(
$param
,
15
);
...
...
@@ -306,14 +307,14 @@ class Shop extends Basic
$result
[
"plan_images"
]
=
$this
->
gHousesImgModel
->
getHouseImages
(
$param
,
1
);
if
(
$params
[
'site_area'
]
==
3
||
$params
[
"site_area"
]
==
4
)
{
$result
[
'landlord_phone'
]
=
json_decode
(
$result
[
'landlord_phone'
],
true
);
$result
[
'create_time'
]
=
date
(
'Y-m-d'
,
strtotime
(
$result
[
'create_time'
]));
$result
[
'create_time'
]
=
date
(
'Y-m-d'
,
strtotime
(
$result
[
'create_time'
]));
}
if
(
$params
[
'site_area'
]
==
4
)
{
//封面图
$param
[
"img_type"
]
=
1
;
$cover_plan
=
$this
->
gHousesImgModel
->
getHouseImages
(
$param
,
15
);
$result
[
"cover_plan"
]
=
$cover_plan
[
0
];
$param
[
"img_type"
]
=
1
;
$cover_plan
=
$this
->
gHousesImgModel
->
getHouseImages
(
$param
,
15
);
$result
[
"cover_plan"
]
=
$cover_plan
[
0
];
}
if
(
$result
[
'status'
]
==
0
)
{
...
...
@@ -340,7 +341,7 @@ class Shop extends Basic
// 计数开始
if
(
$params
[
"site_area"
]
==
3
||
$params
[
"site_area"
]
==
4
&&
$result
)
{
if
(
$params
[
"site_area"
]
==
3
||
$params
[
"site_area"
]
==
4
&&
$result
)
{
$lookShopArr
=
$this
->
lookShopService_
->
countLookShopNum
((
int
)
$this
->
agentId
,
(
int
)
$params
[
"id"
]);
//判断看铺数量是否上限
if
(
$lookShopArr
)
{
...
...
@@ -353,17 +354,17 @@ class Shop extends Basic
}
//上传人
$m_agent
=
new
AAgents
();
$upload_data
=
$m_agent
->
getAgentById
(
'name,phone'
,[
'agent_id'
=>
$result
[
'upload_id'
]
]);
$result
[
'upload_user'
]
=
$upload_data
[
0
][
'name'
]
.
'-'
.
$upload_data
[
0
][
'phone'
];
$m_agent
=
new
AAgents
();
$upload_data
=
$m_agent
->
getAgentById
(
'name,phone'
,
[
'agent_id'
=>
$result
[
'upload_id'
]
]);
$result
[
'upload_user'
]
=
$upload_data
[
0
][
'name'
]
.
'-'
.
$upload_data
[
0
][
'phone'
];
//独家方
if
(
$result
[
'is_exclusive_type'
]
==
1
)
{
$m_house_agent
=
new
GHousesToAgents
();
$where_house
[
'is_del'
]
=
0
;
$where_house
[
'type'
]
=
3
;
$where_house
[
'houses_id'
]
=
$result
[
'id'
];
$house_agent_data
=
$m_house_agent
->
getAgentsByHouseId
(
'name,phone'
,
$where_house
);
$m_house_agent
=
new
GHousesToAgents
();
$where_house
[
'is_del'
]
=
0
;
$where_house
[
'type'
]
=
3
;
$where_house
[
'houses_id'
]
=
$result
[
'id'
];
$house_agent_data
=
$m_house_agent
->
getAgentsByHouseId
(
'name,phone'
,
$where_house
);
$result
[
'exclusive_user'
]
=
$house_agent_data
[
0
][
'name'
];
$result
[
'exclusive_phone'
]
=
$house_agent_data
[
0
][
'phone'
];
}
...
...
@@ -373,12 +374,12 @@ class Shop extends Basic
$result
[
"is_collect"
]
=
2
;
if
(
$params
[
'site_area'
]
==
3
)
{
//先判断是否已经存在数据
$field
=
'id,status'
;
$get_params
[
'agents_id'
]
=
$params
[
"user_id"
];
$get_params
[
'house_id'
]
=
$params
[
"id"
];
$collect_house
=
new
ACollectHouse
();
$res
=
$collect_house
->
getCollectHouse
(
$field
,
$get_params
);
if
(
$res
&&
(
$res
[
0
][
'status'
]
==
1
))
{
//如果存在
$field
=
'id,status'
;
$get_params
[
'agents_id'
]
=
$params
[
"user_id"
];
$get_params
[
'house_id'
]
=
$params
[
"id"
];
$collect_house
=
new
ACollectHouse
();
$res
=
$collect_house
->
getCollectHouse
(
$field
,
$get_params
);
if
(
$res
&&
(
$res
[
0
][
'status'
]
==
1
))
{
//如果存在
$result
[
"is_collect"
]
=
1
;
}
}
...
...
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