InviteLogService.class.php
1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Created by PhpStorm.
* User: zhonglei
* Date: 2017/6/21
* Time: 17:14
*/
namespace Common\Service;
use Common\Common\Constant;
use Common\Common\Notice;
use Common\Model\InviteLogModel;
class InviteLogService extends AbstractService
{
// 构造方法
public function __construct()
{
parent::__construct();
$this->_d = new InviteLogModel();
}
/**
* 被邀请人员给邀请人员发送消息
* @param string $uid 当前用户UID
* @param array $question 问题详情
* @return bool
*/
public function send_invite_msg($uid = '', $question = [])
{
// 组装搜索手机端已邀请未参与人员参数
$inviteParams = [
'uid' => $uid,
'ea_id' => '',
'question_id' => $question['question_id'],
'read' => 0
];
// 查询当前用户是否手机端未读的邀请人员
$inviteLogService = new InviteLogService();
$inviteLogInfo = $inviteLogService->get_by_conds($inviteParams);
if (!empty($inviteLogInfo)) {
// 发消息给邀请人员
Notice::instance()->NoticeTInviteMsg([$inviteLogInfo['invite']], $question);
$inviteLogService->update_by_conds($inviteParams, ['read' => '1']);
}
return true;
}
}