Commit 49d699cf authored by clone's avatar clone

系统消息

parent bc01c200
......@@ -22,6 +22,7 @@ use app\model\GHousesImgs;
use app\model\HouseImgs;
use app\model\HouseinfoExts;
use app\model\HouseInfos;
use app\model\MPushMessage;
use app\model\Users;
use think\Cache;
use think\Exception;
......@@ -361,7 +362,6 @@ class AppChat extends Basic
}
/**
* 获取聊天关系
* @return \think\Response
......@@ -428,7 +428,7 @@ class AppChat extends Basic
$result = $user->getAgentByUserId($field, $params_);
if (count($result) > 0) {
$result_["id"] = $result[0]["id"];
$result_["agent_id"] = 'agent_'.$result[0]["id"];
$result_["agent_id"] = 'agent_' . $result[0]["id"];
$result_["user_name"] = $result[0]["user_name"];
$result_["user_nick"] = $result[0]["user_nick"];
$result_["user_pic"] = !empty($result[0]["user_pic"]) ? HEADERIMGURL . $result[0]["user_pic"] : $result[0]["other_pic"];
......@@ -441,5 +441,69 @@ class AppChat extends Basic
}
/**系统消息商铺修改消息
* @return \think\Response
*/
public function getSystemMessageByShop()
{
$params = $this->params;
/* $params = array(
"agent_id" => 5740,
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
if (!isset($params['agent_id'])) {
return $this->response("101", "请求参数错误");
}
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "id,addressee_id,type,message,house_id,create_time";
//获取此经纪人的所有盘方楼盘id
$params["addressee_id"] = $params["agent_id"];
$params["type"] = array( "in", array( "1,3" ) );
$msgModel = new MPushMessage();
$history_result = $msgModel->getListByWhere($field, $params, $page_no, $page_size);
return $this->response("200", "request success", array_reverse($history_result));
}
/**
* 系统消息客户修改消息
* @return \think\Response
*/
public function getSystemMessageByUser()
{
$params = $this->params;
/* $params = array(
"agent_id" => 5740,
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
if (!isset($params['agent_id'])) {
return $this->response("101", "请求参数错误");
}
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "id,addressee_id,type,message,user_id,create_time";
//获取此经纪人的所有盘方楼盘id
$params["addressee_id"] = $params["agent_id"];
$params["type"] = 2;
$msgModel = new MPushMessage();
$history_result = $msgModel->getListByWhere($field, $params, $page_no, $page_size);
return $this->response("200", "request success", array_reverse($history_result));
}
}
<?php
namespace app\index\controller;
use app\index\extend\Basic;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/9/11
* Time : 16:37
* Intro:
*/
class InviteTotal extends Basic{
}
\ No newline at end of file
......@@ -211,4 +211,14 @@ class MPushMessage
}
return $result;
}
public function getListByWhere(string $field, array $params,int $page_no = 1,int $page_size = 15) : array
{
$this->db_
->field($field)
->where($params)
->page($page_no)
->limit($page_size)
->select();
}
}
\ No newline at end of file
......@@ -296,8 +296,6 @@ Route::group('index', [
'operationalData' => [ 'index/OperationalData/operationalDataList', [ 'method' => 'POST|GET' ] ],//运营数据统计liu
'lookShopIndex' => [ 'index/LookShop/lookShopIndex', [ 'method' => 'GET' ] ],//商铺查看日志
......@@ -404,8 +402,6 @@ Route::group('api', [
'saveSiteCity' => [ 'api/Location/saveSiteCity', [ 'method' => 'POST|GET' ] ], //保存默认城市选择 c端
]);
Route::group('chat', [
......@@ -426,6 +422,12 @@ Route::group('chat', [
'pushMsg_gethouseinfo' => [ 'chat/AppChat/getHouseInfoByFrom', [ 'method' => 'post|get' ] ],
'getUserInfoByFrom' => [ 'chat/AppChat/getUserInfoByFrom', [ 'method' => 'post|get' ] ],
'getChatRelation' => [ 'chat/AppChat/getChatRelation', [ 'method' => 'post|get' ] ],
'getSystemMessageByShop' => [ 'chat/AppChat/getSystemMessageByShop', [ 'method' => 'post|get' ] ],
'getSystemMessageByUser' => [ 'chat/AppChat/getSystemMessageByUser', [ 'method' => 'post|get' ] ],
]);
Route::group('task', [
......@@ -622,10 +624,6 @@ Route::group('broker', [
'bargainMain' => [ 'api_broker/Bargain/bargainList', [ 'method' => 'POST|GET' ] ],
]);
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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