src/Biz/File/Dao/Impl/UploadFileDaoImpl.php

(开头部分) 1KB

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

<?php

namespace Biz\File\Dao\Impl;

use Biz\File\Dao\UploadFileDao;
use Codeages\Biz\Framework\Dao\GeneralDaoImpl;

class UploadFileDaoImpl extends GeneralDaoImpl implements UploadFileDao
{
    protected $table = 'upload_files';

    public function create($file)
    {
        if (!isset($file['id'])) {
            return array();
        }

        parent::create($file);

        return $this->get($file['id']);
    }

    public function getByHashId($hash)
    {
        return $this->getByFields(array(
            'hashId' => $hash,
        ));
    }

    public function getByGlobalId($globalId)
    {
        return $this->getByFields(array(
            'globalId' => $globalId,
        ));
    }

    public function getByConvertHash($hash)
    {
        return $this->getByFields(array(
            'convertHash' => $hash,
        ));
    }

    public function findByIds($ids)
    {
        return $this->findInField('id', $ids);
    }

    public function findByTargetTypeAndTargetIds($targetType, $targetIds)
    {
        if (empty($targetIds)) {
            return array();
        }

        $marks = str_repeat('?,', count($targetIds) - 1).'?';
        $sql = "SELECT * FROM {$this->table()} WHERE targetType = ? AND targetId IN ({$marks})";

        return $this->db()->fetchAll($sql, array_merge(array($targetType), $targetIds)) ?: array();
    }

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

AI 解读 AI

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

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