Commit 7e177a61 authored by clone's avatar clone

bug

parent ec964a74
...@@ -222,7 +222,7 @@ class Shop extends Basic ...@@ -222,7 +222,7 @@ class Shop extends Basic
} }
$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);
......
...@@ -306,10 +306,10 @@ class AppChat extends Basic ...@@ -306,10 +306,10 @@ class AppChat extends Basic
public function getHouseInfoByFrom() public function getHouseInfoByFrom()
{ {
$params = $this->params; $params = $this->params;
$params = array( /* $params = array(
'id' => 4762, 'id' => 3,
'from' => 'b' 'from' => 'b'
); );*/
if (!isset($params['id']) || !isset($params['from'])) { if (!isset($params['id']) || !isset($params['from'])) {
return $this->response("300", "参数不全"); return $this->response("300", "参数不全");
} }
...@@ -319,28 +319,43 @@ class AppChat extends Basic ...@@ -319,28 +319,43 @@ class AppChat extends Basic
$gHousesModel = new GHouses(); $gHousesModel = new GHouses();
//internal_title c端 //internal_title c端
if($params["from"] == "b"){ if ($params["from"] == "b") {
$field = "id,external_title as title,shop_area_start,shop_area_end,rent_type,rent_price"; $field = "id,external_title as title,shop_area_start,shop_area_end,rent_type,rent_price";
}else{ } else {
$field = "id,internal_title as title,shop_area_start,shop_area_end,rent_type,rent_price"; $field = "id,internal_title as title,shop_area_start,shop_area_end,rent_type,rent_price";
} }
$result = $gHousesModel->getHouseDetailById($field, $conditions); $result = $gHousesModel->getHouseInfoById($field, $conditions);
if (count($result) > 0) {
$gHousesImgModel = new GHousesImgs();
$gHousesImgModel = new GHousesImgs();
$param["house_id"] = $params['id']; $param["house_id"] = $params['id'];
$param["img_type"] = 1; $param["img_type"] = 1;
$images = $gHousesImgModel->getHouseImages($param, 1); $images = $gHousesImgModel->getHouseImages($param, 1);
$data['$images'] = IMG_PATH . '/img/houseinfobackgroundimg_new.png'; $data['$images'] = IMG_PATH . '/img/houseinfobackgroundimg_new.png';
if(count($images) > 0){ if (count($images) > 0) {
$result["imagename"] = IMG_PATH . $images[0]["img_name"]; $result["imagename"] = IMG_PATH . $images[0]["img_name"];
}
//1.月租金 2.营业额扣点 3.每平方米租金',
$message = "";
switch ($result['rent_type']) {
case 1:
$message = '月租金:' . $result['rent_price'] . '元/月';
break;
case 2:
$message = '营业额扣点:' . $result['rent_price'] * 0.01 . '%';
break;
case 3:
$message = '每平方米租金:' . $result['rent_price'] . '元/天/㎡';
break;
}
$result['price'] = $message;
return $this->response("200", "success!", $result);
} else {
return $this->response("400", "暂无数据!");
} }
} }
......
...@@ -508,6 +508,18 @@ class GHouses extends BaseModel ...@@ -508,6 +508,18 @@ class GHouses extends BaseModel
->find($params["id"]); ->find($params["id"]);
} }
/**
* 楼盘info
* @param $field
* @param $params
* @return array|false|\PDOStatement|string|\think\Model
*/
public function getHouseInfoById($field, $params)
{
return Db::table($this->table)
->field($field)
->find($params["id"]);
}
/** /**
* 获取经纪人时间段中新添加的楼盘个数 * 获取经纪人时间段中新添加的楼盘个数
* @param $params * @param $params
......
...@@ -298,7 +298,7 @@ Route::group('chat', [ ...@@ -298,7 +298,7 @@ Route::group('chat', [
'delGroupUserByIds' => [ 'chat/Group/delGroupUserByIds', [ 'method' => 'post|get' ] ], 'delGroupUserByIds' => [ 'chat/Group/delGroupUserByIds', [ 'method' => 'post|get' ] ],
'addGroupManage' => [ 'chat/Group/addGroupManage', [ 'method' => 'post|get' ] ], 'addGroupManage' => [ 'chat/Group/addGroupManage', [ 'method' => 'post|get' ] ],
'delGroupManage' => [ 'chat/Group/delGroupManage', [ 'method' => 'post|get' ] ], 'delGroupManage' => [ 'chat/Group/delGroupManage', [ 'method' => 'post|get' ] ],
'pushMsg_gethouseinfo' => [ 'chat/AppChat/pushMsg_gethouseinfo', [ 'method' => 'post|get' ] ], 'pushMsg_gethouseinfo' => [ 'chat/AppChat/getHouseInfoByFrom', [ 'method' => 'post|get' ] ],
]); ]);
Route::group('task',[ Route::group('task',[
......
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