Commit 525e380e authored by hujun's avatar hujun

评论文案修改

parent ba65ca49
...@@ -174,7 +174,7 @@ class Square extends Basic ...@@ -174,7 +174,7 @@ class Square extends Basic
return $this->response("101", "参数不全"); return $this->response("101", "参数不全");
} }
$result = $this->s_square->addBCommentExt($params['comment_id'], $this->agentId, $params['agent_id_b'], $result = $this->s_square->addBCommentExt($params['comment_id'], $this->agentId, $params['agent_id_b'],
$comment, $level, $this->agentName, $square_id); $comment, $level, $square_id);
break; break;
default: default:
return $this->response("101", "请求参数level错误"); return $this->response("101", "请求参数level错误");
......
...@@ -206,7 +206,7 @@ class PushMessageService ...@@ -206,7 +206,7 @@ class PushMessageService
* @param string $url * @param string $url
* @return bool|void * @return bool|void
*/ */
public function pushAll(string $title = '', string $content = '', string $url = '') public function pushAll(string $title, string $content, string $url)
{ {
if (!$this->pushAllow()) { if (!$this->pushAllow()) {
return false; return false;
......
...@@ -353,8 +353,12 @@ class SquareService ...@@ -353,8 +353,12 @@ 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(); if ($square_id > 0) {
$push_service->record(10, $square_id, [$agent_b], $agent_id, ['message' => $agent_name . '评论了你的开盘']); $square_data = $this->m_square->getSquare('agent_id,title', ['id'=>$square_id]);
$message = "你的开盘【{$square_data[0]['title']}】有了一条";
$push_service = new PushMessageService();
$push_service->record(10, $square_id, [$square_data[0]['agent_id']], $agent_id, ['status'=>1 ,'message' => $message.'新评论']);
}
return true; return true;
} else { } else {
return false; return false;
...@@ -372,7 +376,7 @@ class SquareService ...@@ -372,7 +376,7 @@ class SquareService
* @param $square_id * @param $square_id
* @return bool * @return bool
*/ */
public function addBCommentExt($comment_id, $agent_id_a, $agent_id_b, $comment, $level, $agent_name, $square_id) public function addBCommentExt($comment_id, $agent_id_a, $agent_id_b, $comment, $level, $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 回复人
...@@ -384,8 +388,14 @@ class SquareService ...@@ -384,8 +388,14 @@ 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(); if ($square_id > 0) {
$push_service->record(11, $square_id, [$agent_id_b], $agent_id_a, ['message' => $agent_name . '回复了你的开盘评论']); $square_data = $this->m_square->getSquare('agent_id,title', ['id'=>$square_id]);
$message = "【{$square_data[0]['title']}】有了一条";
$push_service = new PushMessageService();
$push_service->record(11, $square_id, [$agent_id_b], $agent_id_a, ['message' => '你的评论'.$message.'新回复']);
$push_service->record(10, $square_id, [$square_data[0]['agent_id']], $agent_id_a, ['status'=>1 ,'message' => '你的开盘'.$message.'新评论']);
}
return true; return true;
} else { } else {
return false; return false;
......
...@@ -140,8 +140,12 @@ class MPushMessage ...@@ -140,8 +140,12 @@ class MPushMessage
$insert_data[$k]['order_id'] = $data['order_id']; $insert_data[$k]['order_id'] = $data['order_id'];
} }
if (isset($data['status'])) {
$insert_data[$k]['status'] = $data['status'];
} else {
$insert_data[$k]['status'] = 0;
}
$insert_data[$k]['type'] = $type; $insert_data[$k]['type'] = $type;
$insert_data[$k]['status'] = 0;
$insert_data[$k]['operation_id'] = $operation_id; $insert_data[$k]['operation_id'] = $operation_id;
} }
......
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