src/Biz/Thread/Dao/Impl/ThreadPostDaoImpl.php

(开头部分) 1KB

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

<?php

namespace Biz\Thread\Dao\Impl;

use Biz\Thread\Dao\ThreadPostDao;
use Codeages\Biz\Framework\Dao\GeneralDaoImpl;

class ThreadPostDaoImpl extends GeneralDaoImpl implements ThreadPostDao
{
    protected $table = 'thread_post';

    public function deletePostsByThreadId($threadId)
    {
        return $this->db()->delete($this->table, array('threadId' => $threadId));
    }

    public function deletePostsByParentId($parentId)
    {
        return $this->db()->delete($this->table, array('parentId' => $parentId));
    }

    public function findThreadIds($conditions)
    {
        $builder = $this->createQueryBuilder($conditions)
            ->select('threadId');

        return $builder->execute()->fetchAll(0) ?: array();
    }

    public function declares()
    {
        $declares['orderbys'] = array(
            'createdTime',
            'updatedTime',
            'ups',
        );

        $declares['conditions'] = array(
            'userId = :userId',
            'userId NOT IN (:notUserIds)',
            'userId IN (:userIds)',
            'id < :id',
            'id < :lessThanId',
            'id >= :greaterThanId',
            'ups >= :ups_GT',
            'id NOT IN (:excludeIds)',
            'createdTime >= :GTEcreatedTime',
            'parentId = :parentId',
            'threadId = :threadId',
            'targetId = :targetId',
            'targetId IN (:targetIds)',
            'targetType = :targetType',
            'adopted = :adopted',
        );

        $declares['serializes'] = array(
            'ats' => 'json',
        );

        return $declares;

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

AI 解读 AI

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

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