Commit a562a2b8 authored by clone's avatar clone

聊天bug

parent c7f24cd0
......@@ -118,10 +118,10 @@ class AppChat extends Basic
if (!isset($params['only_id']) || !isset($params['source'])) {
return $this->response(ErrorCodeConst::ERROR_CODE_PARAM_NOT_EXIST, "请求参数错误");
}
/* $params = array(
"only_id" => "agent_9",
"source" => 2,// 1经纪人 or 2用户
);*/
/* $params = array(
"only_id" => "agent_5",
"source" => 2,// 1经纪人 or 2用户
);*/
$result = $this->_chat->getUserInfo($params['only_id'], $params["source"]);
if ($result) {
......@@ -166,7 +166,7 @@ class AppChat extends Basic
return $this->response(ErrorCodeConst::ERROR_CODE_TARGET_TYPE_ERROR, "错误的消息类型");
}
$result = $this->_chat->sendMsg($user_name,$target_type, $target, $source, $is_user, $type, $msg_content, $from, $this->accessToken);
$result = $this->_chat->sendMsg($user_name, $target_type, $target, $source, $is_user, $type, $msg_content, $from, $this->accessToken);
if ($result) {
return $this->response("200", "", [ "msg" => "消息发送成功" ]);
} else {
......
......@@ -247,8 +247,7 @@ class ChatService
$field = "a.id,a.name as user_nick,a.phone as user_phone,a.img as user_pic,CONCAT(c.district_name,'-',b.store_name) as shop_name";
$where_agent["a.phone"] = array( "in", $agent_phone );
$where_agent["phone"] = array( "in", $agent_phone );
$agentsResult = $this->agentsV2Model->getAgentsInfoByAgentId($field, $where_agent);
foreach ($agentsResult as $v) {
......
......@@ -48,14 +48,14 @@ class Banner extends Basic
*/
public function getBannerList()
{
$field = "id,title,pic_path,url,sort,hits,is_show,up_user,create_time,update_time";
$field = "id,title,pic_path,url,sort,hits,is_show,up_user,create_time,update_time";
$params['is_show'] = array( "eq", 0 );
$params['type'] = array( "eq", 0 );
$pageNo = empty($_POST['pageNo']) ? 1 : $_POST['pageNo'];
$pageSize = empty($_POST['pageSize']) ? 15 : $_POST['pageSize'];
$result["list"] = $this->bannerModel
$params['type'] = array( "eq", 0 );
$pageNo = empty($_POST['pageNo']) ? 1 : $_POST['pageNo'];
$pageSize = empty($_POST['pageSize']) ? 15 : $_POST['pageSize'];
$result["list"] = $this->bannerModel
->getBannerList($pageNo, $pageSize, "sort desc", $field, $params);
$result["total"] = $this->bannerModel
$result["total"] = $this->bannerModel
->getBannerTotal($params);
return $this->response("200", "request success", $result);
}
......@@ -66,14 +66,14 @@ class Banner extends Basic
*/
public function getPopList()
{
$field = "id,title,pic_path,url,sort,hits,is_show,up_user,create_time,update_time";
$field = "id,title,pic_path,url,sort,hits,is_show,up_user,create_time,update_time";
$params['is_show'] = array( "eq", 0 );
$params['type'] = array( "eq", 1 );
$pageNo = empty($_POST['pageNo']) ? 1 : $_POST['pageNo'];
$pageSize = empty($_POST['pageSize']) ? 15 : $_POST['pageSize'];
$result["list"] = $this->bannerModel
$params['type'] = array( "eq", 1 );
$pageNo = empty($_POST['pageNo']) ? 1 : $_POST['pageNo'];
$pageSize = empty($_POST['pageSize']) ? 15 : $_POST['pageSize'];
$result["list"] = $this->bannerModel
->getBannerList($pageNo, $pageSize, "sort desc", $field, $params);
$result["total"] = $this->bannerModel
$result["total"] = $this->bannerModel
->getBannerTotal($params);
return $this->response("200", "request success", $result);
}
......@@ -117,7 +117,7 @@ class Banner extends Basic
if (isset($params['id'])) {
$msg = "修改";
} else {
$msg = "新增";
$msg = "新增";
$params["is_show"] = 0;
}
$result = $this->bannerModel->addOrUpdate($params);
......@@ -135,15 +135,15 @@ class Banner extends Basic
*/
public function upIsShow()
{
$params = array(
"id" => $_POST["id"],
"is_show" => $_POST["is_show"]
);
$result = $this->bannerModel->upIsShow($params);
if ($result['code'] == 200) {
return $this->response("200", "update success", $result["msg"]);
} else {
return $this->response("101", "update error");
}
$params = array(
"id" => $_POST["id"],
"is_show" => $_POST["is_show"]
);
$result = $this->bannerModel->upIsShow($params);
if ($result['code'] == 200) {
return $this->response("200", "update success", $result["msg"]);
} else {
return $this->response("101", "update error");
}
}
}
\ No newline at end of file
......@@ -427,6 +427,9 @@ class AAgents extends BaseModel
if (isset($params["agent_id"])) {
$where_["a.id"] = $params["agent_id"];
}
if (isset($params["phone"])) {
$where_["a.phone"] = $params["phone"];
}
if (isset($params["store_id"])) {
$where_["b.id"] = $params["store_id"];
$where_["a.level"] = array("in","20,40");
......
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