Commit 1947a05e authored by hujun's avatar hujun

推送记录

parent 4095398c
...@@ -89,15 +89,15 @@ class Square extends Basic ...@@ -89,15 +89,15 @@ class Square extends Basic
} }
if (isset($params['level'])) { if (isset($params['level'])) {
if (!isset($params['comment_id']) or !isset($params['agent_id_b']) or !isset($params['comment'])) { if (!isset($params['comment_id']) or !isset($params['agent_id_b']) or !isset($params['comment']) or !isset($params['square_id'])) {
return $this->response("101", "参数不全"); return $this->response("101", "参数不全");
} }
$result = $this->s_square->addBCommentExt($params['comment_id'],$this->agentId,$params['agent_id_b'],$params['comment'],$params['level']); $result = $this->s_square->addBCommentExt($params['comment_id'],$this->agentId,$params['agent_id_b'],$params['comment'],$params['level'], $this->agentName, $params['square_id']);
}else{ }else{
if (!isset($params['square_id']) or !isset($params['square_id']) or !isset($params['comment'])) { if (!isset($params['square_id']) or !isset($params['author_id']) or !isset($params['comment'])) {
return $this->response("101", "参数不全"); return $this->response("101", "参数不全");
} }
$result = $this->s_square->addBComent($params['square_id'],$params['comment'],$this->agentId); $result = $this->s_square->addBComent($params['square_id'],$params['comment'],$this->agentId, $this->params['author_id'], $this->agentName);
} }
if($result){ if($result){
......
...@@ -223,7 +223,7 @@ class SquareService ...@@ -223,7 +223,7 @@ class SquareService
public function addBComent($square_id,$comment,$agent_id) public function addBComent($square_id,$comment,$agent_id, $agent_b, $agent_name)
{ {
$insert["square_id"] = $square_id;//文章id $insert["square_id"] = $square_id;//文章id
$insert["comment"] = $comment;//评价内容 $insert["comment"] = $comment;//评价内容
...@@ -234,13 +234,15 @@ class SquareService ...@@ -234,13 +234,15 @@ class SquareService
$res = $this->m_coment->saveComment($insert);//int(1) $res = $this->m_coment->saveComment($insert);//int(1)
if($res == 1){ if($res == 1){
$push_service = new PushMessageService();
$push_service->record(10, $square_id, $agent_b, $agent_id, ['message'=>$agent_name .'评论了你的开盘']);
return true; return true;
}else{ }else{
return false; return false;
} }
} }
public function addBCommentExt($comment_id,$agent_id_a,$agent_id_b,$comment,$level) public function addBCommentExt($comment_id,$agent_id_a,$agent_id_b,$comment,$level, $agent_name, $square_id)
{ {
$insert["comment_id"] = $comment_id;//comment_id $insert["comment_id"] = $comment_id;//comment_id
$insert["agent_id_a"] = $agent_id_a;//经纪人a 回复人 $insert["agent_id_a"] = $agent_id_a;//经纪人a 回复人
...@@ -252,6 +254,8 @@ class SquareService ...@@ -252,6 +254,8 @@ class SquareService
$res = $this->m_coment_ext->saveCommentExt($insert);//int(1) $res = $this->m_coment_ext->saveCommentExt($insert);//int(1)
if($res == 1){ if($res == 1){
$push_service = new PushMessageService();
$push_service->record(11, $square_id, $agent_id_a, $agent_id_b, ['message'=>$agent_name .'回复了你的开盘评论']);
return true; return true;
}else{ }else{
return false; return false;
......
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