Commit 7e177a61 authored by clone's avatar clone

bug

parent ec964a74
......@@ -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);
......
......@@ -306,10 +306,10 @@ class AppChat extends Basic
public function getHouseInfoByFrom()
{
$params = $this->params;
$params = array(
'id' => 4762,
/* $params = array(
'id' => 3,
'from' => 'b'
);
);*/
if (!isset($params['id']) || !isset($params['from'])) {
return $this->response("300", "参数不全");
}
......@@ -319,28 +319,43 @@ class AppChat extends Basic
$gHousesModel = new GHouses();
//internal_title c端
if($params["from"] == "b"){
$field = "id,external_title as title,shop_area_start,shop_area_end,rent_type,rent_price";
}else{
$field = "id,internal_title as title,shop_area_start,shop_area_end,rent_type,rent_price";
if ($params["from"] == "b") {
$field = "id,external_title as title,shop_area_start,shop_area_end,rent_type,rent_price";
} else {
$field = "id,internal_title as title,shop_area_start,shop_area_end,rent_type,rent_price";
}
$result = $gHousesModel->getHouseDetailById($field, $conditions);
$gHousesImgModel = new GHousesImgs();
$result = $gHousesModel->getHouseInfoById($field, $conditions);
if (count($result) > 0) {
$gHousesImgModel = new GHousesImgs();
$param["house_id"] = $params['id'];
$param["img_type"] = 1;
$images = $gHousesImgModel->getHouseImages($param, 1);
$param["house_id"] = $params['id'];
$param["img_type"] = 1;
$images = $gHousesImgModel->getHouseImages($param, 1);
$data['$images'] = IMG_PATH . '/img/houseinfobackgroundimg_new.png';
if(count($images) > 0){
$result["imagename"] = IMG_PATH . $images[0]["img_name"];
$data['$images'] = IMG_PATH . '/img/houseinfobackgroundimg_new.png';
if (count($images) > 0) {
$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
->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
......
......@@ -298,7 +298,7 @@ Route::group('chat', [
'delGroupUserByIds' => [ 'chat/Group/delGroupUserByIds', [ 'method' => 'post|get' ] ],
'addGroupManage' => [ 'chat/Group/addGroupManage', [ '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',[
......
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