Commit 017be333 authored by zhuwei's avatar zhuwei

聊天获取办公楼信息

parent 2bd12b2c
......@@ -15,11 +15,14 @@ use app\chat\extend\Basic;
use app\chat\service\ChatService;
use app\chat\utils\RPush;
use app\extra\RedisPackage;
use app\index\service\OfficeRoomService;
use app\model\AAgents;
use app\model\ChatMsg;
use app\model\GHouses;
use app\model\GHousesImgs;
use app\model\MPushMessage;
use app\model\OfficeGImg;
use app\model\OfficeGRoom;
use app\model\Users;
use think\Cache;
use think\Exception;
......@@ -463,6 +466,34 @@ class AppChat extends Basic
}
/**
* 聊天获取办公楼信息
* @return \think\Response
*/
public function getOfficeRoomInfo()
{
$params = $this->params;
/*$params = array(
'id' => 1,
);*/
if (!isset($params['id'])) {
return $this->response("300", "参数不全");
}
$m_office_room = new OfficeGRoom();
$service_room = new OfficeRoomService();
$field = 'b.title,a.area,a.price';
$result = $m_office_room->getOfficeRoomInfo($field, ['a.id' => $params['id']]);
if ($result) {
$result['price'] = $result['price'] * 0.01;
$result['carousel_image'] = $service_room->getCarouselImageByOne($params['id'],2);
return $this->response("200", "success!", $result);
} else {
return $this->response("400", "暂无数据!");
}
}
/**系统消息商铺修改消息
* @return \think\Response
*/
......
......@@ -773,6 +773,18 @@ class OfficeRoomService
}
return $house_img_data ? $house_img_data : [];
}
//轮播图一张
public function getCarouselImageByOne($id, $img_type = 2)
{
$where['img_type'] = $img_type;
$where['img_status'] = 0;
$where['house_id'] = $id;
$house_img_data = $this->m_office_img->getOfficeRoomInfoImg('id,img_name', $where);
if ($house_img_data) {
$house_img_data['image_path'] = $this->internet_path . $house_img_data['img_name'];
}
return $house_img_data ? $house_img_data : [];
}
//交通信息
public function getTrafficInfo($id)
......
......@@ -88,6 +88,20 @@ class OfficeGImg extends BaseModel
->select();
}
/**
* 获取一张轮播图
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
*/
public function getOfficeRoomInfoImg($field, $where)
{
$where['img_status'] = 0;
return $this->db_->field($field)
->where($where)
->find();
}
public function getCoverImage($field, $where)
{
$where['img_status'] = 0;
......
......@@ -625,6 +625,7 @@ Route::group('chat', [
'addGroupManage' => ['chat/Group/addGroupManage', ['method' => 'post|get']],
'delGroupManage' => ['chat/Group/delGroupManage', ['method' => 'post|get']],
'pushMsg_gethouseinfo' => ['chat/AppChat/getHouseInfoByFrom', ['method' => 'post|get']],
'getOfficeRoomInfo' => ['chat/AppChat/getOfficeRoomInfo', ['method' => 'post|get']],
'getUserInfoByFrom' => ['chat/AppChat/getUserInfoByFrom', ['method' => 'post|get']],
'getChatRelation' => ['chat/AppChat/getChatRelation', ['method' => 'post|get']],
'getSystemMessageByShop' => ['chat/AppChat/getSystemMessageByShop', ['method' => 'post|get']],
......
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