Commit baaf46cf authored by clone's avatar clone

楼盘详情

parent 0651497e
......@@ -143,7 +143,8 @@ class Shop extends Basic
{
$params = $this->params;
$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 = [];
if (empty($params['id'])) {
......
......@@ -10,6 +10,7 @@ namespace app\api\extend;
* 基类
*/
use think\Controller;
use think\Exception;
use think\helper\Time;
use think\Request;
use think\Response;
......@@ -42,6 +43,7 @@ class Basic extends Controller
*/
public function __construct(Request $request = null)
{
/* ob_start();
ob_end_flush();
ob_end_clean();
......@@ -50,6 +52,7 @@ class Basic extends Controller
// CORS 跨域 Options 检测响应
$this->corsOptionsHandler();
// 输入对象
$this->request = is_null($request) ? Request::instance() : $request;
......@@ -63,6 +66,9 @@ class Basic extends Controller
}
throw new Exception($this->response("101", "AuthToken失效,请重新登录!"));
/* $jwt = new \Firebase\JWT\JWT();
$this->authToken = $this->params['AuthToken'];
......
<?php
namespace app\app\controller;
use think\Response;
class Index
{
public function index()
......@@ -11,4 +13,48 @@ class Index
{
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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment