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
bdcf7b1e
Commit
bdcf7b1e
authored
Dec 11, 2017
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
看铺记录
parent
b43d4e39
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
113 additions
and
13 deletions
+113
-13
config.php
application/api/config.php
+3
-0
AppointmentTime.php
application/api/controller/AppointmentTime.php
+42
-10
Shop.php
application/api/controller/Shop.php
+14
-1
AppointWatchShop.php
application/model/AppointWatchShop.php
+19
-0
HouseImgs.php
application/model/HouseImgs.php
+25
-1
HouseInfos.php
application/model/HouseInfos.php
+0
-1
route.php
application/route.php
+10
-0
No files found.
application/api/config.php
View file @
bdcf7b1e
<?php
<?php
//配置文件
//配置文件
define
(
'IMG_PATH'
,
'https://admin.tonglianjituan.com/houseImg/'
);
return
[
return
[
'jwt_key'
=>
'tonglian+123'
'jwt_key'
=>
'tonglian+123'
];
];
\ No newline at end of file
application/api/controller/AppointmentTime.php
View file @
bdcf7b1e
...
@@ -35,15 +35,15 @@ class AppointmentTime extends Basic
...
@@ -35,15 +35,15 @@ class AppointmentTime extends Basic
public
function
addAppointmentSeeShop
()
public
function
addAppointmentSeeShop
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/* $params = array(
"user_id" => 1,
"user_id" => 1,
"house_id" => 1,
"house_id" => 1,
"house_title" => "楼盘1",
"house_title" => "楼盘1",
"appellation" => "张三",
"appellation" => "张三",
"phone" => "13817616312",
"phone" => "13817616312",
"expect_time" => time(),
"expect_time" => time(),
"other_require" => "没有其他要求"
"other_require" => "没有其他要求"
);*/
);*/
//todo 验证楼盘信息
//todo 验证楼盘信息
if
(
isset
(
$params
[
"house_id"
])
&&
isset
(
$params
[
"house_title"
]))
{
if
(
isset
(
$params
[
"house_id"
])
&&
isset
(
$params
[
"house_title"
]))
{
$where_
[
"house_id"
]
=
$params
[
"house_id"
];
$where_
[
"house_id"
]
=
$params
[
"house_id"
];
...
@@ -72,8 +72,40 @@ class AppointmentTime extends Basic
...
@@ -72,8 +72,40 @@ class AppointmentTime extends Basic
}
}
public
function
getAppointmentSeeShopList
(){
public
function
getAppointmentSeeShopList
()
{
/* $params = array(
"status" => 2, //看铺状态 0待经纪人确认(确认后存agents_id) 1:待看 2:已看' 如果是待看 0,1 已看是2
"user_id" => "1",//对应u_users表
"pageNo" => "1",
"pageSize" => 15
);*/
$params
=
$this
->
params
;
$field
=
"id,user_id,agent_id,house_id,house_title,appellation,phone,expect_time,other_require,status,
is_cancel,is_evaluate,create_time"
;
$where_
=
[];
if
(
!
isset
(
$params
[
"status"
]))
{
return
$this
->
response
(
"101"
,
"请求状态不能为空"
);
}
if
(
!
isset
(
$params
[
"user_id"
]))
{
return
$this
->
response
(
"101"
,
"请求用户不能为空"
);
}
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$where_
[
"status"
]
=
array
(
"in"
,
$params
[
"status"
]
);
$where_
[
"user_id"
]
=
array
(
"eq"
,
$params
[
"user_id"
]
);
$result
=
$this
->
appointmentTimeModel
->
getAppointWatchShopList
(
$pageNo
,
$pageSize
,
"id desc"
,
$field
,
$where_
);
if
(
count
(
$result
)
>
0
){
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
}
}
...
...
application/api/controller/Shop.php
View file @
bdcf7b1e
...
@@ -10,16 +10,19 @@ namespace app\api\controller;
...
@@ -10,16 +10,19 @@ namespace app\api\controller;
* Intro: 获取商铺list
* Intro: 获取商铺list
*/
*/
use
app\api\extend\Basic
;
use
app\api\extend\Basic
;
use
app\model\HouseImgs
;
use
app\model\HouseInfos
;
use
app\model\HouseInfos
;
class
Shop
extends
Basic
class
Shop
extends
Basic
{
{
protected
$db
;
protected
$db
;
protected
$dbImg
;
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
();
}
}
/**
/**
...
@@ -27,6 +30,7 @@ class Shop extends Basic
...
@@ -27,6 +30,7 @@ class Shop extends Basic
*/
*/
public
function
getShopList
()
public
function
getShopList
()
{
{
/* $params = array(
/* $params = array(
"site_area" => 2, //来源 1首页 2搜索
"site_area" => 2, //来源 1首页 2搜索
"title" => "尚美",
"title" => "尚美",
...
@@ -41,7 +45,7 @@ class Shop extends Basic
...
@@ -41,7 +45,7 @@ class Shop extends Basic
"pageSize" => 15
"pageSize" => 15
);*/
);*/
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$field
=
"id,agent_id,title,address,city,disc,disccircles,sales,yetai,room_area2,shangpu_type,is_test,
$field
=
"id,agent_id,title,address,city,disc,disccircles,sales,yetai,room_area
,room_area
2,shangpu_type,is_test,
room_num_left,shangpu_tags,carefully_chosen,price"
;
room_num_left,shangpu_tags,carefully_chosen,price"
;
$conditions
=
[];
$conditions
=
[];
...
@@ -110,6 +114,15 @@ class Shop extends Basic
...
@@ -110,6 +114,15 @@ class Shop extends Basic
}
}
$result
=
$this
->
db
->
getHouseInfoList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$conditions
);
$result
=
$this
->
db
->
getHouseInfoList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$conditions
);
//获取图片信息
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
"api_path"
]
=
IMG_PATH
;
$param
[
"house_id"
]
=
$val
[
"id"
];
$param
[
"imgtype"
]
=
1
;
//默认主图
$result
[
$key
][
"images"
]
=
$this
->
dbImg
->
getHouseImages
(
$param
,
1
);
}
if
(
empty
(
$result
))
{
if
(
empty
(
$result
))
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
}
...
...
application/model/AppointWatchShop.php
View file @
bdcf7b1e
...
@@ -32,4 +32,23 @@ class AppointWatchShop extends Model
...
@@ -32,4 +32,23 @@ class AppointWatchShop extends Model
}
}
return
[
"code"
=>
"101"
,
"msg"
=>
"数据保存异常,rollback"
];
return
[
"code"
=>
"101"
,
"msg"
=>
"数据保存异常,rollback"
];
}
}
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @return mixed
*/
public
function
getAppointWatchShopList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
)
{
return
$data
=
$this
->
db
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
}
}
application/model/HouseImgs.php
View file @
bdcf7b1e
...
@@ -6,5 +6,29 @@ use think\Model;
...
@@ -6,5 +6,29 @@ use think\Model;
class
HouseImgs
extends
Model
class
HouseImgs
extends
Model
{
{
protected
$table
=
'houseimgs'
;
protected
$table
=
'houseimgs'
;
protected
$db
;
function
__construct
()
{
$this
->
db
=
Db
(
$this
->
table
);
}
/**
* 批量查询商铺图片
* @param $param
* @return mixed
*/
public
function
getHouseImages
(
$param
,
$limit_
)
{
//rank
return
$this
->
db
->
field
(
"id,house_id,img_title,imgtype,imagename"
)
->
where
(
$param
)
->
order
(
"rank desc"
)
->
limit
(
$limit_
)
->
select
();
}
}
}
application/model/HouseInfos.php
View file @
bdcf7b1e
...
@@ -34,7 +34,6 @@ class HouseInfos extends Model
...
@@ -34,7 +34,6 @@ class HouseInfos extends Model
->
limit
(
$pageSize
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
page
(
$pageNo
)
->
select
();
->
select
();
}
}
/**
/**
...
...
application/route.php
View file @
bdcf7b1e
...
@@ -61,6 +61,15 @@ Route::group('api',[
...
@@ -61,6 +61,15 @@ Route::group('api',[
'shopList'
=>
[
'api/shop/getShopList'
,
[
'method'
=>
'post'
]],
'shopList'
=>
[
'api/shop/getShopList'
,
[
'method'
=>
'post'
]],
'shopDetail'
=>
[
'api/shop/getShopDetail'
,
[
'method'
=>
'get'
]],
'shopDetail'
=>
[
'api/shop/getShopDetail'
,
[
'method'
=>
'get'
]],
//get banner
'bannerList'
=>
[
'api/banner/getBannerList'
,
[
'method'
=>
'get'
]],
//get averagePriceAndTurnover
'averagePriceAndTurnover'
=>
[
'api/index/averagePriceAndTurnover'
,[
'method'
=>
'get'
]]
]);
]);
Route
::
miss
(
'api/index/miss'
);
//处理错误的url
Route
::
miss
(
'api/index/miss'
);
//处理错误的url
\ 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