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
baaf46cf
Commit
baaf46cf
authored
Dec 14, 2017
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楼盘详情
parent
0651497e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
1 deletion
+54
-1
Shop.php
application/api/controller/Shop.php
+2
-1
Basic.php
application/api/extend/Basic.php
+6
-0
Index.php
application/app/controller/Index.php
+46
-0
No files found.
application/api/controller/Shop.php
View file @
baaf46cf
...
@@ -143,7 +143,8 @@ class Shop extends Basic
...
@@ -143,7 +143,8 @@ class Shop extends Basic
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$field
=
"id,management_fee,title,address,city,room_area,room_area2,business_area,disc,disccircles,sales,slotting_fee,transfer_fee,
$field
=
"id,management_fee,title,address,city,room_area,room_area2,business_area,disc,disccircles,sales,slotting_fee,transfer_fee,
yetai,room_area2,shangpu_type,is_test,room_num_left,room_num_total,shangpu_tags,carefully_chosen,price,dish,file_path"
;
yetai,room_area2,shangpu_type,is_test,sellingpoint,singn_rule,business_date,start_business_date,opentime,has_gas,traffic,
room_num_left,room_num_total,shangpu_tags,carefully_chosen,price,dish,file_path"
;
$conditions
=
[];
$conditions
=
[];
if
(
empty
(
$params
[
'id'
]))
{
if
(
empty
(
$params
[
'id'
]))
{
...
...
application/api/extend/Basic.php
View file @
baaf46cf
...
@@ -10,6 +10,7 @@ namespace app\api\extend;
...
@@ -10,6 +10,7 @@ namespace app\api\extend;
* 基类
* 基类
*/
*/
use
think\Controller
;
use
think\Controller
;
use
think\Exception
;
use
think\helper\Time
;
use
think\helper\Time
;
use
think\Request
;
use
think\Request
;
use
think\Response
;
use
think\Response
;
...
@@ -42,6 +43,7 @@ class Basic extends Controller
...
@@ -42,6 +43,7 @@ class Basic extends Controller
*/
*/
public
function
__construct
(
Request
$request
=
null
)
public
function
__construct
(
Request
$request
=
null
)
{
{
/* ob_start();
/* ob_start();
ob_end_flush();
ob_end_flush();
ob_end_clean();
ob_end_clean();
...
@@ -50,6 +52,7 @@ class Basic extends Controller
...
@@ -50,6 +52,7 @@ class Basic extends Controller
// CORS 跨域 Options 检测响应
// CORS 跨域 Options 检测响应
$this
->
corsOptionsHandler
();
$this
->
corsOptionsHandler
();
// 输入对象
// 输入对象
$this
->
request
=
is_null
(
$request
)
?
Request
::
instance
()
:
$request
;
$this
->
request
=
is_null
(
$request
)
?
Request
::
instance
()
:
$request
;
...
@@ -63,6 +66,9 @@ class Basic extends Controller
...
@@ -63,6 +66,9 @@ class Basic extends Controller
}
}
throw
new
Exception
(
$this
->
response
(
"101"
,
"AuthToken失效,请重新登录!"
));
/* $jwt = new \Firebase\JWT\JWT();
/* $jwt = new \Firebase\JWT\JWT();
$this->authToken = $this->params['AuthToken'];
$this->authToken = $this->params['AuthToken'];
...
...
application/app/controller/Index.php
View file @
baaf46cf
<?php
<?php
namespace
app\app\controller
;
namespace
app\app\controller
;
use
think\Response
;
class
Index
class
Index
{
{
public
function
index
()
public
function
index
()
...
@@ -11,4 +13,48 @@ class Index
...
@@ -11,4 +13,48 @@ class Index
{
{
return
view
(
'index/share_detail'
);
return
view
(
'index/share_detail'
);
}
}
/**
* 楼盘详情
* @return \think\Response
*/
public
function
getShopDetail
()
{
$id
=
$_GET
[
"id"
];
$field
=
"id,management_fee,title,address,city,room_area,room_area2,business_area,disc,disccircles,sales,slotting_fee,transfer_fee,
yetai,room_area2,shangpu_type,is_test,sellingpoint,singn_rule,business_date,start_business_date,opentime,has_gas,traffic,
room_num_left,room_num_total,shangpu_tags,carefully_chosen,price,dish,file_path"
;
$conditions
=
[];
if
(
empty
(
$id
))
{
return
$this
->
response
(
"101"
,
"详情id不能为空"
);
}
$conditions
[
'id'
]
=
array
(
"eq"
,
$id
);
$conditions
[
'show_all'
]
=
array
(
'eq'
,
0
);
//只显示公开楼盘
$result
=
$this
->
db
->
getHouseDetail
(
$field
,
$conditions
);
$result
[
"api_path"
]
=
IMG_PATH
;
$param
[
"house_id"
]
=
$id
;
$result
[
"images"
]
=
$this
->
dbImg
->
getHouseImages
(
$param
,
15
);
if
(
$result
[
'room_num_left'
]
==
0
)
{
return
$this
->
response
(
"101"
,
'此楼盘已下架'
);
}
return
$this
->
response
(
"200"
,
'request success'
,
$result
);
}
/**
* 输出返回数据
* @param string $msg 提示消息内容
* @param string $code 业务状态码
* @param mixed $data 要返回的数据
* @param string $type 返回类型 JSON XML
* @return Response
*/
public
function
response
(
$code
=
'SUCCESS'
,
$msg
,
$data
=
[],
$type
=
'json'
)
{
$result
=
[
'code'
=>
$code
,
'msg'
=>
$msg
,
'data'
=>
$data
,
'type'
=>
strtolower
(
$type
)
];
return
Response
::
create
(
$result
,
$type
);
}
}
}
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