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
4c999d58
Commit
4c999d58
authored
Oct 31, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
按部门门店经纪人id筛选商铺
parent
1d37dd77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
369 additions
and
298 deletions
+369
-298
Shop.php
application/api/controller/Shop.php
+369
-298
No files found.
application/api/controller/Shop.php
View file @
4c999d58
...
@@ -12,6 +12,7 @@ namespace app\api\controller;
...
@@ -12,6 +12,7 @@ namespace app\api\controller;
use
app\api\extend\Basic
;
use
app\api\extend\Basic
;
use
app\api_broker\service\LookShopService
;
use
app\api_broker\service\LookShopService
;
use
app\api_broker\service\VerifyService
;
use
app\api_broker\service\VerifyService
;
use
app\model\AAgents
;
use
app\model\AttentionModel
;
use
app\model\AttentionModel
;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\GHousesImgs
;
use
app\model\GHousesImgs
;
...
@@ -39,14 +40,14 @@ class Shop extends Basic
...
@@ -39,14 +40,14 @@ class Shop extends Basic
function
__construct
(
$request
=
null
)
function
__construct
(
$request
=
null
)
{
{
parent
::
__construct
(
$request
);
parent
::
__construct
(
$request
);
$this
->
db
=
new
HouseInfos
();
$this
->
db
=
new
HouseInfos
();
$this
->
dbImg
=
new
HouseImgs
();
$this
->
dbImg
=
new
HouseImgs
();
$this
->
labels
=
new
GLabels
();
$this
->
labels
=
new
GLabels
();
$this
->
attentionModel
=
new
AttentionModel
();
$this
->
attentionModel
=
new
AttentionModel
();
$this
->
gHousesModel
=
new
GHouses
();
$this
->
gHousesModel
=
new
GHouses
();
$this
->
gHousesImgModel
=
new
GHousesImgs
();
$this
->
gHousesImgModel
=
new
GHousesImgs
();
$this
->
lookShopService_
=
new
LookShopService
();
$this
->
lookShopService_
=
new
LookShopService
();
$this
->
imageDepotModel
=
new
GImageDepot
();
$this
->
imageDepotModel
=
new
GImageDepot
();
}
}
...
@@ -78,7 +79,10 @@ class Shop extends Basic
...
@@ -78,7 +79,10 @@ class Shop extends Basic
"rent_price_start" => 1000,//租金 rent_price
"rent_price_start" => 1000,//租金 rent_price
"rent_price_end" => 10000,//租金
"rent_price_end" => 10000,//租金
"shop_sign" => "临近地铁,临近地铁2",
"shop_sign" => "临近地铁,临近地铁2",
"agent_id" => 630, //添加经纪人id
"p_agent_id" => 630, //添加经纪人id
"p_district_id" => 1, //部门id
"p_store_id" => 1, //门店id
"status" => 1, //1上架or2下架
"status" => 1, //1上架or2下架
"start_time" => "2018-05-25",
"start_time" => "2018-05-25",
"end_time" => "2018-05-30",
"end_time" => "2018-05-30",
...
@@ -97,36 +101,36 @@ class Shop extends Basic
...
@@ -97,36 +101,36 @@ class Shop extends Basic
$conditions
[
"city"
]
=
trim
(
$params
[
'city'
]);
$conditions
[
"city"
]
=
trim
(
$params
[
'city'
]);
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
//c端查对外的名字 b端查对内的名字
//c端查对外的名字 b端查对内的名字
if
(
isset
(
$params
[
'title'
]))
{
if
(
isset
(
$params
[
'title'
]))
{
$conditions
[
'external_title|external_address'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'title'
])
.
"%"
);
$conditions
[
'external_title|external_address'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'title'
])
.
"%"
);
}
}
//c端查对外的名字 b端查对内的名字
//c端查对外的名字 b端查对内的名字
if
(
isset
(
$params
[
'address'
]))
{
if
(
isset
(
$params
[
'address'
]))
{
$conditions
[
'external_address'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'address'
])
.
"%"
);
$conditions
[
'external_address'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'address'
])
.
"%"
);
}
}
if
(
isset
(
$params
[
'house_id'
]))
{
if
(
isset
(
$params
[
'house_id'
]))
{
$conditions
[
'id'
]
=
array
(
"eq"
,
$params
[
'house_id'
]
);
$conditions
[
'id'
]
=
array
(
"eq"
,
$params
[
'house_id'
]
);
}
}
if
(
isset
(
$params
[
'start_time'
])
&&
isset
(
$params
[
'end_time'
]))
{
if
(
isset
(
$params
[
'start_time'
])
&&
isset
(
$params
[
'end_time'
]))
{
$start_time
=
date
(
'Y-m-d H:i:s'
,
$params
[
'start_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'
]);
$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_
=
""
;
$order_
=
""
;
$spTagArr
=
array
();
$spTagArr
=
array
();
switch
(
$params
[
'site_area'
])
{
switch
(
$params
[
'site_area'
])
{
case
1
:
case
1
:
if
(
isset
(
$params
[
'is_carefully_chosen'
])
&&
$params
[
'is_carefully_chosen'
]
==
1
)
{
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"
;
$order_
=
"home_page_sort desc, id desc"
;
}
}
...
@@ -134,45 +138,45 @@ class Shop extends Basic
...
@@ -134,45 +138,45 @@ class Shop extends Basic
case
2
:
case
2
:
case
6
:
case
6
:
if
(
isset
(
$params
[
'disc'
]))
{
//区域
if
(
isset
(
$params
[
'disc'
]))
{
//区域
$conditions
[
'disc'
]
=
array
(
'eq'
,
trim
(
$params
[
'disc'
])
);
$conditions
[
'disc'
]
=
array
(
'eq'
,
trim
(
$params
[
'disc'
])
);
}
}
if
(
isset
(
$params
[
'business_id'
]))
{
//商圈
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'
]))
{
//业态
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'
]))
{
//商铺类型
if
(
isset
(
$params
[
'shop_type'
]))
{
//商铺类型
$conditions
[
'shop_type'
]
=
array
(
"eq"
,
$params
[
'shop_type'
]
);
$conditions
[
'shop_type'
]
=
array
(
"eq"
,
$params
[
'shop_type'
]
);
}
}
$area_start
=
isset
(
$params
[
'shop_area_start'
])
?
$params
[
'shop_area_start'
]
:
-
1
;
$area_start
=
isset
(
$params
[
'shop_area_start'
])
?
$params
[
'shop_area_start'
]
:
-
1
;
$area_end
=
isset
(
$params
[
'shop_area_end'
])
?
$params
[
'shop_area_end'
]
:
-
1
;
$area_end
=
isset
(
$params
[
'shop_area_end'
])
?
$params
[
'shop_area_end'
]
:
-
1
;
if
(
$area_start
>=
0
&&
$area_end
>=
0
)
{
//面积
if
(
$area_start
>=
0
&&
$area_end
>=
0
)
{
//面积
$conditions
[
'shop_area_start'
]
=
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
)
);
$conditions
[
'shop_area_end'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
}
else
if
(
$area_start
>=
0
&&
$area_end
<
0
)
{
//100米以上不用传结束面积
}
else
if
(
$area_start
>=
0
&&
$area_end
<
0
)
{
//100米以上不用传结束面积
$conditions
[
'shop_area_start'
]
=
array
(
'egt'
,
$area_start
);
$conditions
[
'shop_area_start'
]
=
array
(
'egt'
,
$area_start
);
$conditions
[
'shop_area_end'
]
=
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_start
=
isset
(
$params
[
'rent_price_start'
])
?
$params
[
'rent_price_start'
]
:
-
1
;
$price_end
=
isset
(
$params
[
'rent_price_end'
])
?
$params
[
'rent_price_end'
]
:
-
1
;
$price_end
=
isset
(
$params
[
'rent_price_end'
])
?
$params
[
'rent_price_end'
]
:
-
1
;
if
(
$price_start
>=
0
&&
$price_end
>=
0
)
{
//金额
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
)
{
}
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'
]
!=
"全部"
)
{
//商铺标签
if
(
isset
(
$params
[
'shop_sign'
])
&&
$params
[
'shop_sign'
]
!=
"全部"
)
{
//商铺标签
$shopTagsArr
=
array_filter
(
explode
(
','
,
$params
[
'shop_sign'
]));
$shopTagsArr
=
array_filter
(
explode
(
','
,
$params
[
'shop_sign'
]));
if
(
count
(
$shopTagsArr
)
==
1
)
{
if
(
count
(
$shopTagsArr
)
==
1
)
{
$spTagArr
[
'shop_sign'
]
=
array
(
'like'
,
"%"
.
trim
(
$shopTagsArr
[
0
])
.
"%"
);
$spTagArr
[
'shop_sign'
]
=
array
(
'like'
,
"%"
.
trim
(
$shopTagsArr
[
0
])
.
"%"
);
}
else
{
}
else
{
foreach
(
$shopTagsArr
as
$key
=>
$val
)
{
foreach
(
$shopTagsArr
as
$key
=>
$val
)
{
$spTagArr
[
'shop_sign'
][]
=
array
(
'like'
,
"%"
.
trim
(
$val
)
.
"%"
);
$spTagArr
[
'shop_sign'
][]
=
array
(
'like'
,
"%"
.
trim
(
$val
)
.
"%"
);
}
}
}
}
}
}
...
@@ -182,72 +186,136 @@ class Shop extends Basic
...
@@ -182,72 +186,136 @@ class Shop extends Basic
return
$this
->
response
(
"101"
,
"请求数据异常"
);
return
$this
->
response
(
"101"
,
"请求数据异常"
);
}
}
if
(
!
empty
(
$conditions
))
{
if
(
!
empty
(
$conditions
))
{
$conditions
[
'status'
]
=
array
(
'eq'
,
1
);
//只显示上架
$conditions
[
'status'
]
=
array
(
'eq'
,
1
);
//只显示上架
$conditions
[
'is_show'
]
=
array
(
'eq'
,
0
);
//c端只显示可显示的楼盘
$conditions
[
'is_show'
]
=
array
(
'eq'
,
0
);
//c端只显示可显示的楼盘
}
}
$result
=
$this
->
gHousesModel
->
getHousesList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$conditions
,
$spTagArr
);
//获取图片信息
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
"api_path"
]
=
SHOP_IMAGE_DEPOT_URL
;
$result
[
$key
][
"rent_price"
]
=
$val
[
"rent_price"
]
*
0.01
;
$result
[
$key
][
"images"
]
=
[];
if
(
$val
[
"external_image_id"
])
{
$param
[
"id"
]
=
array
(
"in"
,
$val
[
"external_image_id"
]
);
$param
[
"img_status"
]
=
0
;
$field
=
'id,0 as house_id,img_type,label,img_name,img_status'
;
$res
=
$this
->
imageDepotModel
->
getImageDepotById
(
$field
,
$param
,
1
);
$houseIds
=
""
;
$result
[
$key
][
"images"
]
=
count
(
$res
)
>
0
?
$res
:
[];
if
(
isset
(
$params
[
'p_district_id'
])
||
isset
(
$params
[
'p_store_id'
])
||
isset
(
$params
[
'p_agent_id'
]))
{
$p_district_id
=
empty
(
$params
[
'p_district_id'
])
?
""
:
$params
[
'p_district_id'
];
$p_store_id
=
empty
(
$params
[
'p_store_id'
])
?
""
:
$params
[
'p_store_id'
];
$p_agent_id
=
empty
(
$params
[
'p_agent_id'
])
?
""
:
$params
[
'p_agent_id'
];
$houseIds
=
$this
->
returnHouseIdByPanParty
(
$p_district_id
,
$p_store_id
,
$p_agent_id
);
if
(
empty
(
$houseIds
))
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
}
}
}
if
(
!
empty
(
$houseIds
))
{
if
(
$params
[
'site_area'
]
==
6
){
$conditions
[
'id'
]
=
array
(
"in"
,
$houseIds
);
$list
[
"list"
]
=
$result
;
$total
=
$this
->
gHousesModel
->
getHousesCount
(
$conditions
,
$spTagArr
);
$list
[
"total"
]
=
$total
;
return
$this
->
response
(
"200"
,
'request success'
,
$list
);
}
}
$result
=
$this
->
gHousesModel
->
getHousesList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$conditions
,
$spTagArr
);
if
(
empty
(
$result
))
{
//获取图片信息
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
foreach
(
$result
as
$key
=>
$val
)
{
}
$result
[
$key
][
"api_path"
]
=
SHOP_IMAGE_DEPOT_URL
;
$result
[
$key
][
"rent_price"
]
=
$val
[
"rent_price"
]
*
0.01
;
$result
[
$key
][
"images"
]
=
[];
if
(
$val
[
"external_image_id"
])
{
$param
[
"id"
]
=
array
(
"in"
,
$val
[
"external_image_id"
]);
$param
[
"img_status"
]
=
0
;
return
$this
->
response
(
"200"
,
'request success'
,
$result
);
$field
=
'id,0 as house_id,img_type,label,img_name,img_status'
;
}
$res
=
$this
->
imageDepotModel
->
getImageDepotById
(
$field
,
$param
,
1
);
$result
[
$key
][
"images"
]
=
count
(
$res
)
>
0
?
$res
:
[];
}
}
if
(
$params
[
'site_area'
]
==
6
)
{
$list
[
"list"
]
=
$result
;
$total
=
$this
->
gHousesModel
->
getHousesCount
(
$conditions
,
$spTagArr
);
$list
[
"total"
]
=
$total
;
return
$this
->
response
(
"200"
,
'request success'
,
$list
);
}
if
(
empty
(
$result
))
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
return
$this
->
response
(
"200"
,
'request success'
,
$result
);
}
/**
/**
* 楼盘详情
* 返回盘方楼盘id
* @return \think\Response
* @param $p_district_id
* @param $p_store_id
* @param $p_agent_id
* @return false|null|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
p
ublic
function
getShopDetail
(
)
p
rivate
function
returnHouseIdByPanParty
(
$p_district_id
,
$p_store_id
,
$p_agent_id
)
{
{
header
(
'Access-Control-Allow-Origin:*'
);
$agentModel
=
new
AAgents
();
$params
=
$this
->
params
;
$params
=
[];
/* $params = array(
if
(
$p_district_id
)
{
"id" => 7407,
$params
[
"c.id"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_district_id
)
.
"%"
);
"site_area" => 3, //1.c端 3.b端 4.pc端
}
//"user_id" => 2 //if c端 用户登录后传入user_id
if
(
$p_store_id
)
{
);*/
$params
[
"b.id"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_store_id
)
.
"%"
);
}
if
(
$p_agent_id
)
{
$params
[
"a.id"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_agent_id
)
.
"%"
);
}
$ids
=
""
;
if
(
empty
(
$params
))
{
return
$ids
;
}
$agentArr
=
$agentModel
->
getAgentsInfoByShop
(
"a.id"
,
$params
);
$agentIds
=
""
;
if
(
count
(
$agentArr
)
<
1
)
{
return
$ids
;
}
else
{
foreach
(
$agentArr
as
$item
)
{
$agentIds
.=
$item
[
"id"
]
.
","
;
}
$agentIds
=
rtrim
(
$agentIds
,
","
);
$conditions
=
[];
if
(
empty
(
$params
[
'id'
]))
{
return
$this
->
response
(
"101"
,
"详情id不能为空"
);
}
}
if
(
empty
(
$params
[
'site_area'
]))
{
return
$this
->
response
(
"101"
,
"请求来源错误"
);
$verifyService
=
new
VerifyService
();
$selectParams
=
array
(
"in"
,
$agentIds
);
$houseIds
=
$verifyService
->
getPanpartyByAgentId
(
$selectParams
);
if
(
$houseIds
)
{
$ids
=
$houseIds
;
}
}
return
$ids
;
}
$field
=
"a.id,a.external_title as title,a.external_address as address,a.city,a.disc,a.business_district_id,a.status,a.external_image_id,
/**
* 楼盘详情
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getShopDetail
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"id" => 7407,
"site_area" => 3, //1.c端 3.b端 4.pc端
//"user_id" => 2 //if c端 用户登录后传入user_id
);*/
$conditions
=
[];
if
(
empty
(
$params
[
'id'
]))
{
return
$this
->
response
(
"101"
,
"详情id不能为空"
);
}
if
(
empty
(
$params
[
'site_area'
]))
{
return
$this
->
response
(
"101"
,
"请求来源错误"
);
}
$field
=
"a.id,a.external_title as title,a.external_address as address,a.city,a.disc,a.business_district_id,a.status,a.external_image_id,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,
a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,
b.enter_num,b.external_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
b.enter_num,b.external_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
...
@@ -255,265 +323,268 @@ class Shop extends Basic
...
@@ -255,265 +323,268 @@ class Shop extends Basic
b.area_width,b.depth,b.electric_quantity,b.voltage,b.exhaust_fume,b.running_water,b.downriver,b.business_scope,b.decoration
b.area_width,b.depth,b.electric_quantity,b.voltage,b.exhaust_fume,b.running_water,b.downriver,b.business_scope,b.decoration
,b.rim_mating,b.section,b.crowd,b.other"
;
,b.rim_mating,b.section,b.crowd,b.other"
;
$conditions
[
'a.status'
]
=
array
(
"eq"
,
1
);
$conditions
[
'a.status'
]
=
array
(
"eq"
,
1
);
$conditions
[
'a.is_show'
]
=
array
(
'eq'
,
0
);
//c端只显示公开楼盘
$conditions
[
'a.is_show'
]
=
array
(
'eq'
,
0
);
//c端只显示公开楼盘
$conditions
[
'a.id'
]
=
array
(
"eq"
,
$params
[
"id"
]
);
$conditions
[
'a.id'
]
=
array
(
"eq"
,
$params
[
"id"
]
);
$result
=
$this
->
gHousesModel
->
getHouseDetailById
(
$field
,
$conditions
);
$result
=
$this
->
gHousesModel
->
getHouseDetailById
(
$field
,
$conditions
);
if
(
count
(
$result
)
<=
0
)
{
if
(
count
(
$result
)
<=
0
)
{
return
$this
->
response
(
"101"
,
'此楼盘不存在'
);
return
$this
->
response
(
"101"
,
'此楼盘不存在'
);
}
}
if
(
$result
[
"start_business_date"
]
==
"0000-00-00 00:00:00"
||
empty
(
$result
[
"start_business_date"
]))
{
if
(
$result
[
"start_business_date"
]
==
"0000-00-00 00:00:00"
||
empty
(
$result
[
"start_business_date"
]))
{
$result
[
"start_business_date"
]
=
""
;
$result
[
"start_business_date"
]
=
""
;
}
else
{
}
else
{
$result
[
"start_business_date"
]
=
date
(
"Y-m-d"
,
strtotime
(
$result
[
"start_business_date"
]));
$result
[
"start_business_date"
]
=
date
(
"Y-m-d"
,
strtotime
(
$result
[
"start_business_date"
]));
}
}
if
(
$result
[
"opening_date"
]
==
"0000-00-00 00:00:00"
||
empty
(
$result
[
"opening_date"
]))
{
if
(
$result
[
"opening_date"
]
==
"0000-00-00 00:00:00"
||
empty
(
$result
[
"opening_date"
]))
{
$result
[
"opening_date"
]
=
""
;
$result
[
"opening_date"
]
=
""
;
}
else
{
}
else
{
$result
[
"opening_date"
]
=
date
(
"Y-m-d"
,
strtotime
(
$result
[
"opening_date"
]));
$result
[
"opening_date"
]
=
date
(
"Y-m-d"
,
strtotime
(
$result
[
"opening_date"
]));
}
}
$result
[
"rent_price"
]
=
$result
[
"rent_price"
]
*
0.01
;
$result
[
"rent_price"
]
=
$result
[
"rent_price"
]
*
0.01
;
$result
[
"management_fee"
]
=
$result
[
"management_fee"
]
*
0.01
;
$result
[
"management_fee"
]
=
$result
[
"management_fee"
]
*
0.01
;
$result
[
"slotting_fee"
]
=
$result
[
"slotting_fee"
]
*
0.01
;
$result
[
"slotting_fee"
]
=
$result
[
"slotting_fee"
]
*
0.01
;
if
(
$result
[
"external_slotting_fee"
]
!=
'-1'
)
{
if
(
$result
[
"external_slotting_fee"
]
!=
'-1'
)
{
$result
[
"external_slotting_fee"
]
=
$result
[
"external_slotting_fee"
]
*
0.01
;
$result
[
"external_slotting_fee"
]
=
$result
[
"external_slotting_fee"
]
*
0.01
;
}
}
$result
[
"api_path"
]
=
SHOP_IMAGE_DEPOT_URL
;
$result
[
"api_path"
]
=
SHOP_IMAGE_DEPOT_URL
;
//$param["house_id"] = $params['id'];
//$param["house_id"] = $params['id'];
//todo 这里的是否要更改成b端后台上传的类型
//todo 这里的是否要更改成b端后台上传的类型
/* $param["img_type"] = 2;
/* $param["img_type"] = 2;
$result["images"] = $this->gHousesImgModel->getHouseImages($param, 15);
$result["images"] = $this->gHousesImgModel->getHouseImages($param, 15);
$param["img_type"] = 3;//图片类型:1效果图,2实景图,3样板图,4户型图,5交通图
$param["img_type"] = 3;//图片类型:1效果图,2实景图,3样板图,4户型图,5交通图
$result["plan_images"] = $this->gHousesImgModel->getHouseImages($param, 1);*/
$result["plan_images"] = $this->gHousesImgModel->getHouseImages($param, 1);*/
$result
[
"images"
]
=
[];
$result
[
"images"
]
=
[];
if
(
$result
[
"external_image_id"
])
{
if
(
$result
[
"external_image_id"
])
{
$param
[
"id"
]
=
array
(
"in"
,
$result
[
"external_image_id"
]
);
$param
[
"id"
]
=
array
(
"in"
,
$result
[
"external_image_id"
]
);
$param
[
"img_status"
]
=
0
;
$param
[
"img_status"
]
=
0
;
$field
=
'id,0 as house_id,img_type,label,img_name,img_status'
;
$field
=
'id,0 as house_id,img_type,label,img_name,img_status'
;
$res
=
$this
->
imageDepotModel
->
getImageDepotById
(
$field
,
$param
);
$res
=
$this
->
imageDepotModel
->
getImageDepotById
(
$field
,
$param
);
$result
[
"images"
]
=
count
(
$res
)
>
0
?
$res
:
[];
$result
[
"images"
]
=
count
(
$res
)
>
0
?
$res
:
[];
}
}
if
(
$result
[
'status'
]
==
0
)
{
if
(
$result
[
'status'
]
==
0
)
{
return
$this
->
response
(
"101"
,
'此楼盘已下架'
);
return
$this
->
response
(
"101"
,
'此楼盘已下架'
);
}
}
//todo 查询关注门店
//todo 查询关注门店
if
(
$params
[
'site_area'
]
==
1
&&
isset
(
$params
[
'user_id'
]))
{
if
(
$params
[
'site_area'
]
==
1
&&
isset
(
$params
[
'user_id'
]))
{
$attention
[
"user_id"
]
=
array
(
"eq"
,
$params
[
'user_id'
]
);
$attention
[
"user_id"
]
=
array
(
"eq"
,
$params
[
'user_id'
]
);
$attention
[
"house_id"
]
=
array
(
"eq"
,
$params
[
"id"
]
);
$attention
[
"house_id"
]
=
array
(
"eq"
,
$params
[
"id"
]
);
$attention
[
"is_del"
]
=
array
(
"eq"
,
0
);
$attention
[
"is_del"
]
=
array
(
"eq"
,
0
);
$attResult
=
$this
->
attentionModel
->
getAttentionByUserIdAndHouseId
(
$attention
);
$attResult
=
$this
->
attentionModel
->
getAttentionByUserIdAndHouseId
(
$attention
);
if
(
count
(
$attResult
)
>
0
)
if
(
count
(
$attResult
)
>
0
)
$result
[
"attention"
]
=
$attResult
[
0
][
"id"
];
$result
[
"attention"
]
=
$attResult
[
0
][
"id"
];
}
}
//todo 查询成交报告中的提交的业态拼接到已入驻中
//todo 查询成交报告中的提交的业态拼接到已入驻中
$bargainModel
=
new
OBargainModel
();
$bargainModel
=
new
OBargainModel
();
$str
=
$bargainModel
->
selectBargainListByHouseId
(
$params
[
"id"
]);
$str
=
$bargainModel
->
selectBargainListByHouseId
(
$params
[
"id"
]);
$result
[
"enter_num"
]
.=
$str
;
$result
[
"enter_num"
]
.=
$str
;
$verify
=
new
VerifyService
();
$verify
=
new
VerifyService
();
$agentId
=
$verify
->
getPanpartyAgentsByHouseId
(
$params
[
"id"
]);
$agentId
=
$verify
->
getPanpartyAgentsByHouseId
(
$params
[
"id"
]);
$result
[
"panParty"
]
=
$agentId
;
$result
[
"panParty"
]
=
$agentId
;
$result
[
'new_sign_rule'
]
=
"付
{
$result
[
'payment_month'
]
}
押
{
$result
[
'deposit_month'
]
}
,签订
{
$result
[
'age_limit'
]
}
年"
;
$result
[
'new_sign_rule'
]
=
"付
{
$result
[
'payment_month'
]
}
押
{
$result
[
'deposit_month'
]
}
,签订
{
$result
[
'age_limit'
]
}
年"
;
$result
[
'payment_deposit'
]
=
empty
(
$result
[
'payment_month'
])
?
""
:
"付
{
$result
[
'payment_month'
]
}
押
{
$result
[
'deposit_month'
]
}
"
;
$result
[
'payment_deposit'
]
=
empty
(
$result
[
'payment_month'
])
?
""
:
"付
{
$result
[
'payment_month'
]
}
押
{
$result
[
'deposit_month'
]
}
"
;
$result
[
'age_limit'
]
=
empty
(
$result
[
'age_limit'
])
?
""
:
"签订
{
$result
[
'age_limit'
]
}
年"
;
$result
[
'age_limit'
]
=
empty
(
$result
[
'age_limit'
])
?
""
:
"签订
{
$result
[
'age_limit'
]
}
年"
;
return
$this
->
response
(
"200"
,
'request success'
,
$result
);
return
$this
->
response
(
"200"
,
'request success'
,
$result
);
}
}
/**
/**
* 搜索页搜索条件
* 搜索页搜索条件
* @return \think\Response
* @return \think\Response
*/
*/
public
function
filtrateCondition
()
public
{
function
filtrateCondition
()
header
(
'Access-Control-Allow-Origin:*'
);
{
$params
=
$this
->
params
;
header
(
'Access-Control-Allow-Origin:*'
);
$city_code
=
isset
(
$params
[
"city_code"
])
?
$params
[
"city_code"
]
:
"330000"
;
//上海310000 浙江 330000
$params
=
$this
->
params
;
$city_code
=
isset
(
$params
[
"city_code"
])
?
$params
[
"city_code"
]
:
"330000"
;
//上海310000 浙江 330000
$regions
=
new
Regions
();
$cityList
=
$regions
->
getRegionsCitySH
(
$city_code
);
$regions
=
new
Regions
();
$i
=
$j
=
0
;
$cityList
=
$regions
->
getRegionsCitySH
(
$city_code
);
$result
[
"area"
][
$i
][
"city"
]
=
"全部"
;
$i
=
$j
=
0
;
$result
[
"area"
][
$i
][
"disc"
][]
=
"全部"
;
$result
[
"area"
][
$i
][
"city"
]
=
"全部"
;
foreach
(
$cityList
as
$k
=>
$v
)
{
$result
[
"area"
][
$i
][
"disc"
][]
=
"全部"
;
$i
++
;
foreach
(
$cityList
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
"name"
]))
{
$i
++
;
$result
[
"area"
][
$i
][
"city"
]
=
$v
[
"name"
];
if
(
!
empty
(
$v
[
"name"
]))
{
$result
[
"area"
][
$i
][
"disc"
][]
=
"全"
.
$v
[
"name"
];
$result
[
"area"
][
$i
][
"city"
]
=
$v
[
"name"
];
}
$result
[
"area"
][
$i
][
"disc"
][]
=
"全"
.
$v
[
"name"
];
foreach
(
$v
[
"city"
]
as
$item
)
{
}
if
(
!
empty
(
$item
))
{
foreach
(
$v
[
"city"
]
as
$item
)
{
$result
[
"area"
][
$i
][
"disc"
][]
=
$item
;
if
(
!
empty
(
$item
))
{
$result
[
"area"
][
$i
][
"disc"
][]
=
$item
;
}
}
}
}
if
(
$j
==
0
)
{
if
(
$j
==
0
)
{
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'district'
]
=
"全"
.
$v
[
"name"
];
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'district'
]
=
"全"
.
$v
[
"name"
];
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'business'
][]
=
[
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'business'
][]
=
[
'id'
=>
0
,
'name'
=>
'全部'
'id'
=>
0
,
'name'
=>
'全部'
];
];
}
}
foreach
(
$v
[
'business_district'
]
as
$item2
)
{
foreach
(
$v
[
'business_district'
]
as
$item2
)
{
if
(
!
empty
(
$item2
))
{
if
(
!
empty
(
$item2
))
{
$j
++
;
$j
++
;
$result
[
"area"
][
$i
][
"business_district"
][
$j
]
=
$item2
;
$result
[
"area"
][
$i
][
"business_district"
][
$j
]
=
$item2
;
}
}
}
}
break
;
//目前只有上海和杭州其余的先不显示
break
;
//目前只有上海和杭州其余的先不显示
}
}
$result
[
'yetai'
]
=
array
(
'全部'
,
'商场美食'
,
'沿街餐饮'
,
'百货超市'
,
'服饰鞋包'
,
'亲子教育'
,
'休闲娱乐'
,
'办公'
,
'其他'
);
$result
[
'yetai'
]
=
array
(
'全部'
,
'商场美食'
,
'沿街餐饮'
,
'百货超市'
,
'服饰鞋包'
,
'亲子教育'
,
'休闲娱乐'
,
'办公'
,
'其他'
);
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
$result
[
'money'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'3万以上'
),
$result
[
'money'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'3万以上'
),
array
(
'id'
=>
'1'
,
'value'
=>
'1万-3万'
),
array
(
'id'
=>
'2'
,
'value'
=>
'1万以下'
)
);
array
(
'id'
=>
'1'
,
'value'
=>
'1万-3万'
),
array
(
'id'
=>
'2'
,
'value'
=>
'1万以下'
)
);
//面积
//面积
$result
[
'acreage'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'30m²以内'
),
$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'
=>
'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²以上'
)
);
,
array
(
'id'
=>
'4'
,
'value'
=>
'300-500m²'
),
array
(
'id'
=>
'5'
,
'value'
=>
'500m²以上'
)
);
$result
[
'more'
][]
=
"全部"
;
$result
[
'more'
][]
=
"全部"
;
$labelsResult
=
$this
->
labels
->
getLabels
();
$labelsResult
=
$this
->
labels
->
getLabels
();
if
(
count
(
$labelsResult
)
>
0
)
{
if
(
count
(
$labelsResult
)
>
0
)
{
foreach
(
$labelsResult
as
$labelsKey
=>
$labelsVal
)
{
foreach
(
$labelsResult
as
$labelsKey
=>
$labelsVal
)
{
if
(
$labelsVal
[
'name'
])
{
if
(
$labelsVal
[
'name'
])
{
$result
[
'more'
][]
=
$labelsVal
[
'name'
];
$result
[
'more'
][]
=
$labelsVal
[
'name'
];
}
}
}
}
}
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
/**
/**
* 搜索页搜索条件
* 搜索页搜索条件
* @return \think\Response
* @return \think\Response
*/
*/
public
function
filtrateConditionV2
()
public
{
function
filtrateConditionV2
()
header
(
'Access-Control-Allow-Origin:*'
);
{
$params
=
$this
->
params
;
header
(
'Access-Control-Allow-Origin:*'
);
if
(
empty
(
$params
[
"city"
])){
$params
=
$this
->
params
;
return
$this
->
response
(
"101"
,
"参数错误"
);
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
)
{
$city
=
$params
[
"city"
];
if
(
!
empty
(
$item
))
{
$result
[
"area"
][
$i
][
"disc"
][]
=
$item
;
$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
)
{
if
(
$j
==
0
)
{
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'district'
]
=
"全"
.
$v
[
"name"
];
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'district'
]
=
"全"
.
$v
[
"name"
];
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'business'
][]
=
[
$result
[
"area"
][
$i
][
"business_district"
][
$j
][
'business'
][]
=
[
'id'
=>
0
,
'name'
=>
'全部'
'id'
=>
0
,
'name'
=>
'全部'
];
];
}
}
foreach
(
$v
[
'business_district'
]
as
$item2
)
{
foreach
(
$v
[
'business_district'
]
as
$item2
)
{
if
(
!
empty
(
$item2
))
{
if
(
!
empty
(
$item2
))
{
$j
++
;
$j
++
;
$result
[
"area"
][
$i
][
"business_district"
][
$j
]
=
$item2
;
$result
[
"area"
][
$i
][
"business_district"
][
$j
]
=
$item2
;
}
}
}
}
break
;
//目前只有上海和杭州其余的先不显示
break
;
//目前只有上海和杭州其余的先不显示
}
}
$result
[
'yetai'
]
=
array
(
'全部'
,
'商场美食'
,
'沿街餐饮'
,
'百货超市'
,
'服饰鞋包'
,
'亲子教育'
,
'休闲娱乐'
,
'办公'
,
'其他'
);
$result
[
'yetai'
]
=
array
(
'全部'
,
'商场美食'
,
'沿街餐饮'
,
'百货超市'
,
'服饰鞋包'
,
'亲子教育'
,
'休闲娱乐'
,
'办公'
,
'其他'
);
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
$result
[
'money'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'3万以上'
),
$result
[
'money'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'3万以上'
),
array
(
'id'
=>
'1'
,
'value'
=>
'1万-3万'
),
array
(
'id'
=>
'2'
,
'value'
=>
'1万以下'
)
);
array
(
'id'
=>
'1'
,
'value'
=>
'1万-3万'
),
array
(
'id'
=>
'2'
,
'value'
=>
'1万以下'
)
);
//面积
//面积
$result
[
'acreage'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'30m²以内'
),
$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'
=>
'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²以上'
)
);
,
array
(
'id'
=>
'4'
,
'value'
=>
'300-500m²'
),
array
(
'id'
=>
'5'
,
'value'
=>
'500m²以上'
)
);
$result
[
'more'
][]
=
"全部"
;
$result
[
'more'
][]
=
"全部"
;
$labelsResult
=
$this
->
labels
->
getLabels
();
$labelsResult
=
$this
->
labels
->
getLabels
();
if
(
count
(
$labelsResult
)
>
0
)
{
if
(
count
(
$labelsResult
)
>
0
)
{
foreach
(
$labelsResult
as
$labelsKey
=>
$labelsVal
)
{
foreach
(
$labelsResult
as
$labelsKey
=>
$labelsVal
)
{
if
(
$labelsVal
[
'name'
])
{
if
(
$labelsVal
[
'name'
])
{
$result
[
'more'
][]
=
$labelsVal
[
'name'
];
$result
[
'more'
][]
=
$labelsVal
[
'name'
];
}
}
}
}
}
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
/**
/**
* 商铺列表进场统计
* 商铺列表进场统计
* @return \think\Response
* @return \think\Response
*/
*/
public
function
getMarchInList
()
public
{
function
getMarchInList
()
$params
=
$this
->
params
;
{
/* $params = array(
$params
=
$this
->
params
;
"house_id" => 7277,
/* $params = array(
"is_return_list" => 2,//1只返回统计2,返回列表
"house_id" => 7277,
"page_no" => 1,
"is_return_list" => 2,//1只返回统计2,返回列表
"page_size" => 15
"page_no" => 1,
);*/
"page_size" => 15
$checkResult
=
$this
->
validate
(
$params
,
"ShopValidate.getMarchInList"
);
);*/
if
(
true
!==
$checkResult
)
{
$checkResult
=
$this
->
validate
(
$params
,
"ShopValidate.getMarchInList"
);
return
$this
->
response
(
"101"
,
$checkResult
);
if
(
true
!==
$checkResult
)
{
}
return
$this
->
response
(
"101"
,
$checkResult
);
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
}
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$marchInModel
=
new
OMarchInModel
();
$attentionModel
=
new
AttentionModel
();
$marchInModel
=
new
OMarchInModel
();
$attentionModel
=
new
AttentionModel
();
$week_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$month_time
=
date
(
"Y-m-d"
,
strtotime
(
"-30 day"
));
$week_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$month_time
=
date
(
"Y-m-d"
,
strtotime
(
"-30 day"
));
$week_params
[
'house_id'
]
=
$params
[
'house_id'
];
$week_params
[
'create_time'
]
=
array
(
'gt'
,
$week_time
);
$week_params
[
'house_id'
]
=
$params
[
'house_id'
];
$week_params
[
'create_time'
]
=
array
(
'gt'
,
$week_time
);
$month_params
[
'house_id'
]
=
$params
[
'house_id'
];
$month_params
[
'create_time'
]
=
array
(
'gt'
,
$month_time
);
$month_params
[
'house_id'
]
=
$params
[
'house_id'
];
$month_params
[
'create_time'
]
=
array
(
'gt'
,
$month_time
);
$result_week
=
$marchInModel
->
getMarchInNum
(
$week_params
);
$result_month
=
$marchInModel
->
getMarchInNum
(
$month_params
);
$result_week
=
$marchInModel
->
getMarchInNum
(
$week_params
);
$attention
=
$attentionModel
->
getAttentionNumByHouseId
(
$week_params
);
$result_month
=
$marchInModel
->
getMarchInNum
(
$month_params
);
$attention
=
$attentionModel
->
getAttentionNumByHouseId
(
$week_params
);
$result
[
"week"
]
=
$result_week
[
0
][
"num"
];
$result
[
"month"
]
=
$result_month
[
0
][
"num"
];
$result
[
"week"
]
=
$result_week
[
0
][
"num"
];
$result
[
"last_march_in"
]
=
empty
(
$result_month
[
0
][
"create_time"
])
?
""
:
$result_month
[
0
][
"create_time"
];
$result
[
"month"
]
=
$result_month
[
0
][
"num"
];
$result
[
"attention"
]
=
$attention
+
50
;
//todo 产品定义
$result
[
"last_march_in"
]
=
empty
(
$result_month
[
0
][
"create_time"
])
?
""
:
$result_month
[
0
][
"create_time"
];
if
(
$params
[
"is_return_list"
]
==
2
)
{
$result
[
"attention"
]
=
$attention
+
50
;
//todo 产品定义
$field
=
"a.create_time,c.name,c.img"
;
if
(
$params
[
"is_return_list"
]
==
2
)
{
$marchInList
=
$marchInModel
->
getMarchInList
(
$field
,
$month_params
,
$page_no
,
$page_size
);
$field
=
"a.create_time,c.name,c.img"
;
$result
[
"list"
]
=
$marchInList
;
$marchInList
=
$marchInModel
->
getMarchInList
(
$field
,
$month_params
,
$page_no
,
$page_size
);
$result
[
"img_path"
]
=
AGENTHEADERIMGURL
;
$result
[
"list"
]
=
$marchInList
;
}
$result
[
"img_path"
]
=
AGENTHEADERIMGURL
;
}
return
$this
->
response
(
"200"
,
"success"
,
$result
);
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
}
}
}
\ No newline at end of file
\ No newline at end of file
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