src/Biz/IM/Dao/Impl/ConversationDaoImpl.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Biz\IM\Dao\Impl;

use Biz\IM\Dao\ConversationDao;
use Codeages\Biz\Framework\Dao\GeneralDaoImpl;

class ConversationDaoImpl extends GeneralDaoImpl implements ConversationDao
{
    protected $table = 'im_conversation';

    public function getByMemberIds(array $memberIds)
    {
        if (empty($memberIds)) {
            return array();
        }
        $ids = '|'.implode('|', $memberIds).'|';

        return $this->getByFields(array('memberIds' => $ids));
    }

    public function getByConvNo($convNo)
    {
        return $this->getByFields(array('no' => $convNo));
    }

    public function getByTargetIdAndTargetType($targetId, $targetType)
    {
        return $this->getByFields(array('targetId' => $targetId, 'targetType' => $targetType));
    }

    public function getByMemberHash($memberHash)
    {
        return $this->getByFields(array('memberHash' => $memberHash));
    }

    public function deleteByTargetIdAndTargetType($targetId, $targetType)
    {
        return $this->db()->delete($this->table, array('targetId' => $targetId, 'targetType' => $targetType));
    }

    public function declares()
    {
        return array(
            'timestamps' => array('createdTime'),
            'orderbys' => array('createdTime'),
            'serializes' => array(
                'memberIds' => 'delimiter',
            ),
            'conditions' => array(
                'targetType IN (:targetTypes)',
                'targetId IN (:targetIds)',
                'convNo = :convNo',
            ),
        );
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。