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
01cda0d3
Commit
01cda0d3
authored
Aug 13, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
房东手机号搜索
parent
898e330e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
7 deletions
+54
-7
Shop.php
application/api/controller/Shop.php
+1
-0
Shop.php
application/api_broker/controller/Shop.php
+34
-7
GHousesExt.php
application/model/GHousesExt.php
+19
-0
No files found.
application/api/controller/Shop.php
View file @
01cda0d3
...
...
@@ -183,6 +183,7 @@ class Shop extends Basic
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
"api_path"
]
=
CK_IMG_URL
.
'images/'
;
$result
[
$key
][
"rent_price"
]
=
$val
[
"rent_price"
]
*
0.01
;
$result
[
$key
][
"title"
]
=
$val
[
"city"
]
.
$result
[
$key
][
"title"
];
$param
[
"house_id"
]
=
$val
[
"id"
];
$param
[
"img_type"
]
=
1
;
//默认主图
...
...
application/api_broker/controller/Shop.php
View file @
01cda0d3
...
...
@@ -10,6 +10,7 @@ use app\model\AAgents;
use
app\model\ACollectHouse
;
use
app\model\AttentionModel
;
use
app\model\GHouses
;
use
app\model\GHousesExt
;
use
app\model\GHousesFollowUp
;
use
app\model\GHousesImgs
;
use
app\model\GHousesToAgents
;
...
...
@@ -53,7 +54,7 @@ class Shop extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*
$params = array(
/*
$params = array(
"site_area" => 4, //来源 1c首页 2c搜索 3b首页 4b搜索 5b报备
// "title" => "vv", //1,2 external_title ,3,4internal_title
"house_id" => 4,
...
...
@@ -71,6 +72,7 @@ class Shop extends Basic
"status" => 1, //1上架or2下架
"start_time" => "2018-05-25",
"end_time" => "2018-05-30",
"landlord_phone" => "17621970093",
"pageNo" => 1,
"pageSize" => 15
);*/
...
...
@@ -84,7 +86,7 @@ class Shop extends Basic
,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price"
;
}
else
{
$field
=
"id,internal_title as title,internal_address as address,city,disc,business_district_id,status,industry_type
$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
);
...
...
@@ -108,8 +110,18 @@ class Shop extends Basic
$conditions
[
'internal_address'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'address'
])
.
"%"
);
}
$houseIds
=
""
;
if
(
isset
(
$params
[
'landlord_phone'
]))
{
$houseIds
=
$this
->
returnHouseId
(
$params
[
'landlord_phone'
]);
if
(
empty
(
$houseIds
))
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
}
if
(
isset
(
$params
[
'house_id'
]))
{
$conditions
[
'id'
]
=
array
(
"eq"
,
$params
[
'house_id'
]
);
$houseIds
=
$params
[
'house_id'
];
}
if
(
!
empty
(
$houseIds
))
{
$conditions
[
'id'
]
=
array
(
"in"
,
$houseIds
);
}
if
(
isset
(
$params
[
'start_time'
])
&&
isset
(
$params
[
'end_time'
]))
{
...
...
@@ -204,6 +216,7 @@ class Shop extends Basic
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
"api_path"
]
=
CK_IMG_URL
.
'images/'
;
$result
[
$key
][
"rent_price"
]
=
$val
[
"rent_price"
]
*
0.01
;
$result
[
$key
][
"title"
]
=
$val
[
"city"
]
.
$result
[
$key
][
"title"
];
$param
[
"house_id"
]
=
$val
[
"id"
];
$param
[
"img_type"
]
=
1
;
//默认主图
...
...
@@ -222,6 +235,20 @@ class Shop extends Basic
return
$this
->
response
(
"200"
,
'request success'
,
$result
);
}
private
function
returnHouseId
(
$landlord_phone
)
{
$houseExtModel
=
new
GHousesExt
();
$houseIds
=
$houseExtModel
->
getHouseId
(
$landlord_phone
);
$ids
=
""
;
if
(
count
(
$houseIds
)
>
0
)
{
foreach
(
$houseIds
as
$item
)
{
$ids
.=
$item
[
"house_id"
]
.
","
;
}
$ids
=
rtrim
(
$ids
,
","
);
}
return
$ids
;
}
/**
* 楼盘详情
...
...
@@ -406,9 +433,9 @@ class Shop extends Basic
if
(
$this
->
request
->
isPost
())
{
$validate
=
new
HouseValidate
();
$check
=
$validate
->
check
(
$this
->
params
);
$check
=
$validate
->
check
(
$this
->
params
);
if
(
true
!==
$check
)
{
if
(
true
!==
$check
)
{
return
$this
->
response
(
101
,
$validate
->
getError
());
}
...
...
@@ -449,9 +476,9 @@ class Shop extends Basic
if
(
$this
->
request
->
isPost
())
{
$validate
=
new
HouseValidate
();
$check
=
$validate
->
check
(
$this
->
params
);
$check
=
$validate
->
check
(
$this
->
params
);
if
(
true
!==
$check
)
{
if
(
true
!==
$check
)
{
return
$this
->
response
(
101
,
$validate
->
getError
());
}
$house_id
=
$this
->
gHousesModel
->
app_addV2
(
$this
->
params
,
$this
->
agentId
);
//添加或编辑商铺
...
...
application/model/GHousesExt.php
View file @
01cda0d3
...
...
@@ -9,7 +9,25 @@
namespace
app\model
;
use
Think\Db
;
class
GHousesExt
extends
BaseModel
{
protected
$table
=
'g_houses_ext'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
table
(
$this
->
table
);
}
public
function
getHouseId
(
$landlord_phone
)
{
$params
[
"landlord_phone"
]
=
array
(
"like"
,
'%'
.
$landlord_phone
.
'%'
);
return
$this
->
db_
->
field
(
"house_id"
)
->
where
(
$params
)
->
select
();
}
}
\ 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