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
f5b1d637
Commit
f5b1d637
authored
Oct 09, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
是否对c端显示
parent
b90c6f7d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
44 deletions
+48
-44
Shop.php
application/api_broker/controller/Shop.php
+48
-44
No files found.
application/api_broker/controller/Shop.php
View file @
f5b1d637
...
...
@@ -80,7 +80,8 @@ class Shop extends Basic
"p_district_name" => "一部",
"p_store_name" => "门店",
"p_agent_name" => "张三",
//是否对C端显示 181009
"is_show" => 0,//0是1否显示在c端用户
"pageNo" => 1,
"pageSize" => 15
...
...
@@ -107,23 +108,23 @@ class Shop extends Basic
//c端查对外的名字 b端查对内的名字
if
(
isset
(
$params
[
'title'
])
&&
$params
[
'site_area'
]
==
1
||
$params
[
'site_area'
]
==
2
)
{
$conditions
[
'external_title'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'title'
])
.
"%"
);
$conditions
[
'external_title'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'title'
])
.
"%"
);
}
else
if
(
isset
(
$params
[
'title'
]))
{
$conditions
[
'internal_title'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'title'
])
.
"%"
);
$conditions
[
'internal_title'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'title'
])
.
"%"
);
}
//c端查对外的名字 b端查对内的名字
if
(
isset
(
$params
[
'address'
])
&&
$params
[
'site_area'
]
==
1
||
$params
[
'site_area'
]
==
2
)
{
$conditions
[
'external_address'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'address'
])
.
"%"
);
$conditions
[
'external_address'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'address'
])
.
"%"
);
}
else
if
(
isset
(
$params
[
'address'
]))
{
$conditions
[
'internal_address'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'address'
])
.
"%"
);
$conditions
[
'internal_address'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'address'
])
.
"%"
);
}
if
(
isset
(
$params
[
'start_time'
])
&&
isset
(
$params
[
'end_time'
]))
{
$start_time
=
date
(
'Y-m-d H:i:s'
,
$params
[
'start_time'
]);
$end_time
=
date
(
'Y-m-d H:i:s'
,
$params
[
'end_time'
]);
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
}
$order_
=
""
;
...
...
@@ -132,7 +133,7 @@ class Shop extends Basic
case
1
:
case
3
:
if
(
isset
(
$params
[
'is_carefully_chosen'
])
&&
$params
[
'is_carefully_chosen'
]
==
1
)
{
$conditions
[
'is_carefully_chosen'
]
=
array
(
'eq'
,
$params
[
'is_carefully_chosen'
]
);
$conditions
[
'is_carefully_chosen'
]
=
array
(
'eq'
,
$params
[
'is_carefully_chosen'
]
);
$order_
=
"home_page_sort desc, id desc"
;
}
...
...
@@ -141,17 +142,20 @@ class Shop extends Basic
case
4
:
case
5
:
if
(
isset
(
$params
[
'disc'
]))
{
//区域
$conditions
[
'disc'
]
=
array
(
'eq'
,
trim
(
$params
[
'disc'
])
);
$conditions
[
'disc'
]
=
array
(
'eq'
,
trim
(
$params
[
'disc'
])
);
}
if
(
isset
(
$params
[
'business_id'
]))
{
//商圈
$conditions
[
'business_district_id'
]
=
array
(
'eq'
,
trim
(
$params
[
'business_id'
])
);
$conditions
[
'business_district_id'
]
=
array
(
'eq'
,
trim
(
$params
[
'business_id'
])
);
}
if
(
isset
(
$params
[
'industry_type'
]))
{
//业态
$conditions
[
'industry_type'
]
=
array
(
'like'
,
"%"
.
trim
(
$params
[
'industry_type'
])
.
"%"
);
$conditions
[
'industry_type'
]
=
array
(
'like'
,
"%"
.
trim
(
$params
[
'industry_type'
])
.
"%"
);
}
if
(
isset
(
$params
[
'shop_type'
]))
{
//商铺类型
$conditions
[
'shop_type'
]
=
array
(
"eq"
,
$params
[
'shop_type'
]
);
$conditions
[
'shop_type'
]
=
array
(
"eq"
,
$params
[
'shop_type'
]);
}
if
(
isset
(
$params
[
'is_show'
]))
{
//是否对c端显示
$conditions
[
'is_show'
]
=
array
(
"eq"
,
$params
[
'is_show'
]);
}
//我的商铺 代表我是盘方的商铺
...
...
@@ -159,34 +163,34 @@ class Shop extends Basic
$verifyService
=
new
VerifyService
();
$ids
=
$verifyService
->
getPanpartyByAgentId
(
$params
[
'agent_id'
]);
//$conditions['upload_id'] = array( "eq", $params['agent_id'] );
$conditions
[
'id'
]
=
array
(
"in"
,
$ids
);
$conditions
[
'id'
]
=
array
(
"in"
,
$ids
);
}
$area_start
=
isset
(
$params
[
'shop_area_start'
])
?
$params
[
'shop_area_start'
]
:
-
1
;
$area_end
=
isset
(
$params
[
'shop_area_end'
])
?
$params
[
'shop_area_end'
]
:
-
1
;
if
(
$area_start
>=
0
&&
$area_end
>=
0
)
{
//面积
$conditions
[
'shop_area_start'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
$conditions
[
'shop_area_end'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
$conditions
[
'shop_area_start'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
$conditions
[
'shop_area_end'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
}
else
if
(
$area_start
>=
0
&&
$area_end
<
0
)
{
//100米以上不用传结束面积
$conditions
[
'shop_area_start'
]
=
array
(
'egt'
,
$area_start
);
$conditions
[
'shop_area_end'
]
=
array
(
'egt'
,
$area_start
);
$conditions
[
'shop_area_start'
]
=
array
(
'egt'
,
$area_start
);
$conditions
[
'shop_area_end'
]
=
array
(
'egt'
,
$area_start
);
}
$price_start
=
isset
(
$params
[
'rent_price_start'
])
?
$params
[
'rent_price_start'
]
:
-
1
;
$price_end
=
isset
(
$params
[
'rent_price_end'
])
?
$params
[
'rent_price_end'
]
:
-
1
;
if
(
$price_start
>=
0
&&
$price_end
>=
0
)
{
//金额
$conditions
[
'rent_price'
]
=
array
(
'between'
,
array
(
$price_start
*
100
,
$price_end
*
100
)
);
$conditions
[
'rent_price'
]
=
array
(
'between'
,
array
(
$price_start
*
100
,
$price_end
*
100
)
);
}
else
if
(
$price_start
>=
0
&&
$price_end
<
0
)
{
$conditions
[
'rent_price'
]
=
array
(
'egt'
,
$price_start
*
100
);
$conditions
[
'rent_price'
]
=
array
(
'egt'
,
$price_start
*
100
);
}
if
(
isset
(
$params
[
'shop_sign'
])
&&
$params
[
'shop_sign'
]
!=
"全部"
)
{
//商铺标签
$shopTagsArr
=
array_filter
(
explode
(
','
,
$params
[
'shop_sign'
]));
if
(
count
(
$shopTagsArr
)
==
1
)
{
$spTagArr
[
'shop_sign'
]
=
array
(
'like'
,
"%"
.
trim
(
$shopTagsArr
[
0
])
.
"%"
);
$spTagArr
[
'shop_sign'
]
=
array
(
'like'
,
"%"
.
trim
(
$shopTagsArr
[
0
])
.
"%"
);
}
else
{
foreach
(
$shopTagsArr
as
$key
=>
$val
)
{
$spTagArr
[
'shop_sign'
][]
=
array
(
'like'
,
"%"
.
trim
(
$val
)
.
"%"
);
$spTagArr
[
'shop_sign'
][]
=
array
(
'like'
,
"%"
.
trim
(
$val
)
.
"%"
);
}
}
}
...
...
@@ -196,11 +200,11 @@ class Shop extends Basic
return
$this
->
response
(
"101"
,
"请求数据异常"
);
}
if
(
!
empty
(
$conditions
))
{
$conditions
[
'status'
]
=
array
(
'eq'
,
1
);
//只显示上架
$conditions
[
'status'
]
=
array
(
'eq'
,
1
);
//只显示上架
if
(
$params
[
'site_area'
]
==
1
||
$params
[
'site_area'
]
==
2
)
{
$conditions
[
'is_show'
]
=
array
(
'eq'
,
0
);
//c端只显示可显示的楼盘
$conditions
[
'is_show'
]
=
array
(
'eq'
,
0
);
//c端只显示可显示的楼盘
}
elseif
(
$params
[
"site_area"
]
==
4
)
{
$conditions
[
'status'
]
=
!
empty
(
$params
[
'status'
])
?
$params
[
'status'
]
:
array
(
'in'
,
"1,2"
);
//b端搜索显示上架下架的
$conditions
[
'status'
]
=
!
empty
(
$params
[
'status'
])
?
$params
[
'status'
]
:
array
(
'in'
,
"1,2"
);
//b端搜索显示上架下架的
}
}
...
...
@@ -224,14 +228,14 @@ class Shop extends Basic
}
if
(
!
empty
(
$houseIds
))
{
$conditions
[
'id'
]
=
array
(
"in"
,
$houseIds
);
$conditions
[
'id'
]
=
array
(
"in"
,
$houseIds
);
}
//如果有传经纪人id则代表我的商铺不区分状态
if
(
isset
(
$params
[
'agent_id'
]))
{
unset
(
$conditions
[
"city"
]);
//$conditions['status'] = array( 'in', "1,2" ); //只显示上架或下架的
$conditions
[
'status'
]
=
!
empty
(
$params
[
'status'
])
?
$params
[
'status'
]
:
array
(
'in'
,
"1,2"
);
//只显示上架或下架的
$conditions
[
'status'
]
=
!
empty
(
$params
[
'status'
])
?
$params
[
'status'
]
:
array
(
'in'
,
"1,2"
);
//只显示上架或下架的
}
$result
=
$this
->
gHousesModel
->
getHousesList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$conditions
,
$spTagArr
);
...
...
@@ -252,15 +256,15 @@ class Shop extends Basic
//锁盘后,盘方、独家方、有权限的可以查看
if
(
isset
(
$val
[
'is_lock'
])
&&
$val
[
'is_lock'
]
==
1
)
{
$vip
=
new
VipService
();
if
(
!
$vip
->
vip
(
$this
->
agentId
,
'index/lockHouse'
)
)
{
if
(
!
$vip
->
vip
(
$this
->
agentId
,
'index/lockHouse'
))
{
$result
[
$key
][
"look_lock"
]
=
1
;
}
$m_agent
=
new
GHousesToAgents
();
$agent_data
=
$m_agent
->
getAgentsHouseField
(
'a.id'
,
[
'a.agents_id'
=>
$this
->
agentId
,
'a.type'
=>
[
'in'
,
'2,3'
]]);
$agent_data
=
$m_agent
->
getAgentsHouseField
(
'a.id'
,
[
'a.agents_id'
=>
$this
->
agentId
,
'a.type'
=>
[
'in'
,
'2,3'
]]);
foreach
(
$agent_data
as
$vvv
)
{
if
(
$vvv
>
0
){
if
(
$vvv
>
0
)
{
$result
[
$key
][
"look_lock"
]
=
1
;
}
}
...
...
@@ -296,13 +300,13 @@ class Shop extends Basic
$agentModel
=
new
AAgents
();
$params
=
[];
if
(
$p_district_name
)
{
$params
[
"c.district_name"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_district_name
)
.
"%"
);
$params
[
"c.district_name"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_district_name
)
.
"%"
);
}
if
(
$p_store_name
)
{
$params
[
"b.store_name"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_store_name
)
.
"%"
);
$params
[
"b.store_name"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_store_name
)
.
"%"
);
}
if
(
$p_agent_name
)
{
$params
[
"a.name"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_agent_name
)
.
"%"
);
$params
[
"a.name"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_agent_name
)
.
"%"
);
}
$ids
=
""
;
if
(
empty
(
$params
))
{
...
...
@@ -322,7 +326,7 @@ class Shop extends Basic
}
$verifyService
=
new
VerifyService
();
$selectParams
=
array
(
"in"
,
$agentIds
);
$selectParams
=
array
(
"in"
,
$agentIds
);
$houseIds
=
$verifyService
->
getPanpartyByAgentId
(
$selectParams
);
if
(
$houseIds
)
{
$ids
=
$houseIds
;
...
...
@@ -364,7 +368,7 @@ class Shop extends Basic
b.enter_num,b.internal_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
b.auditorium,b.tiny_brochure_url,b.start_business_date,a.upload_id,b.fee_rule,b.landlord_remark,a.create_time,b.landlord_phone,
a.is_show,a.is_exclusive_type,a.update_time,a.external_title,a.external_address,b.external_item_advantage,b.agent_start_time,b.agent_end_time"
;
$conditions
[
'a.status'
]
=
array
(
"neq"
,
3
);
$conditions
[
'a.status'
]
=
array
(
"neq"
,
3
);
}
else
{
$field
=
"a.id,a.internal_title,a.internal_address,a.external_title,a.external_address,
a.city,a.disc,a.business_district_id,a.status,a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,
...
...
@@ -373,10 +377,10 @@ class Shop extends Basic
b.enter_num,b.internal_item_advantage as item_advantage, b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
b.auditorium,b.tiny_brochure_url,b.start_business_date,a.upload_id,b.fee_rule,b.landlord_remark,a.create_time,b.landlord_phone
,a.update_time,b.agent_start_time,b.agent_end_time,b.internal_item_advantage,b.external_item_advantage"
;
$conditions
[
'a.status'
]
=
array
(
"neq"
,
3
);
$conditions
[
'a.status'
]
=
array
(
"neq"
,
3
);
}
$conditions
[
'a.id'
]
=
array
(
"eq"
,
$params
[
"id"
]
);
$conditions
[
'a.id'
]
=
array
(
"eq"
,
$params
[
"id"
]
);
$field
.=
',b.age_limit,b.payment_month,b.deposit_month,b.external_slotting_fee,c.agents_id, b.area_width,b.depth,
b.electric_quantity,b.voltage,b.exhaust_fume,b.running_water,b.downriver,b.business_scope,b.decoration,b.source
...
...
@@ -426,9 +430,9 @@ class Shop extends Basic
}
//todo 查询关注门店
if
(
$params
[
'site_area'
]
==
1
&&
isset
(
$params
[
'user_id'
]))
{
$attention
[
"user_id"
]
=
array
(
"eq"
,
$params
[
'user_id'
]
);
$attention
[
"house_id"
]
=
array
(
"eq"
,
$params
[
"id"
]
);
$attention
[
"is_del"
]
=
array
(
"eq"
,
0
);
$attention
[
"user_id"
]
=
array
(
"eq"
,
$params
[
'user_id'
]
);
$attention
[
"house_id"
]
=
array
(
"eq"
,
$params
[
"id"
]
);
$attention
[
"is_del"
]
=
array
(
"eq"
,
0
);
$attResult
=
$this
->
attentionModel
->
getAttentionByUserIdAndHouseId
(
$attention
);
if
(
count
(
$attResult
)
>
0
)
$result
[
"attention"
]
=
$attResult
[
0
][
"id"
];
...
...
@@ -459,7 +463,7 @@ class Shop extends Basic
//上传人
$m_agent
=
new
AAgents
();
$upload_data
=
$m_agent
->
getAgentById
(
'name,phone'
,
[
'agent_id'
=>
$result
[
'upload_id'
]
]);
$upload_data
=
$m_agent
->
getAgentById
(
'name,phone'
,
[
'agent_id'
=>
$result
[
'upload_id'
]
]);
$result
[
'upload_user'
]
=
$upload_data
[
0
][
'name'
]
.
'-'
.
$upload_data
[
0
][
'phone'
];
//独家方
...
...
@@ -558,7 +562,7 @@ class Shop extends Basic
$file
=
request
()
->
file
(
'file'
);
if
(
$file
)
{
$path
=
ROOT_PATH
.
'public'
.
DS
.
'resource'
.
DS
.
'lib'
.
DS
.
'Attachments'
.
DS
.
'images'
;
$info
=
$file
->
validate
([
'size'
=>
1024000
,
'ext'
=>
'jpg,png'
])
->
move
(
$path
);
$info
=
$file
->
validate
([
'size'
=>
1024000
,
'ext'
=>
'jpg,png'
])
->
move
(
$path
);
if
(
$info
)
{
$img_path
=
$info
->
getSaveName
();
//生成的图片路径
$data
[
'img_type'
]
=
$this
->
params
[
'img_type'
];
...
...
@@ -612,7 +616,7 @@ class Shop extends Basic
}
else
{
$path
=
ROOT_PATH
.
'public'
.
DS
.
'resource'
.
DS
.
'lib'
.
DS
.
'Attachments'
.
DS
.
'Images/'
;
@
unlink
(
$path
.
$this
->
params
[
'save_path'
]);
$img
->
editData
([
'img_status'
=>
1
],
$id
[
'id'
],
'id'
);
$img
->
editData
([
'img_status'
=>
1
],
$id
[
'id'
],
'id'
);
$data
[
'status'
]
=
200
;
}
...
...
@@ -672,7 +676,7 @@ class Shop extends Basic
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$result
=
$this
->
gHousesModel
->
getHouseInfo
(
'province,city,disc'
,
[
'id'
=>
$params
[
"house_id"
]
]);
$result
=
$this
->
gHousesModel
->
getHouseInfo
(
'province,city,disc'
,
[
'id'
=>
$params
[
"house_id"
]
]);
if
(
$result
)
{
$params
[
'province'
]
=
$result
[
0
][
'province'
]
?
$result
[
0
][
'province'
]
:
'上海市'
;
$params
[
'city'
]
=
$result
[
0
][
'city'
]
?
$result
[
0
][
'city'
]
:
'上海市'
;
...
...
@@ -682,7 +686,7 @@ class Shop extends Basic
$follow_up_model
=
new
GHousesFollowUp
();
$id
=
$follow_up_model
->
addHousesFollowUp
(
$params
);
if
(
$id
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
[
"id"
=>
$id
]);
return
$this
->
response
(
"200"
,
"request success"
,
[
"id"
=>
$id
]);
}
else
{
return
$this
->
response
(
"200"
,
"request error"
);
}
...
...
@@ -704,7 +708,7 @@ class Shop extends Basic
$where
[
'status'
]
=
0
;
if
(
$this
->
params
[
'name'
]
!=
NULL
)
{
$where
[
'name'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'name'
]
.
'%'
];
$where
[
'name'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'name'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'province'
]))
{
...
...
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