src/Biz/Testpaper/Dao/Impl/TestpaperDaoImpl.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace Biz\Testpaper\Dao\Impl;
use Biz\Testpaper\Dao\TestpaperDao;
use Codeages\Biz\Framework\Dao\AdvancedDaoImpl;
class TestpaperDaoImpl extends AdvancedDaoImpl implements TestpaperDao
{
protected $table = 'testpaper_v8';
public function getByIdAndType($id, $type)
{
return $this->getByFields(array('id' => $id, 'type' => $type));
}
public function findTestpapersByIds(array $ids)
{
return $this->findInField('id', $ids);
}
public function findTestpapersByIdsAndType($ids, $type)
{
$marks = str_repeat('?,', count($ids) - 1).'?';
$sql = "select * from {$this->table()} where id in ({$marks}) and type = ?";
$params = $ids;
$params[] = $type;
return $this->db()->fetchAll($sql, $params);
}
public function findTestpapersByCopyIdAndCourseSetIds($copyId, $courseSetIds)
{
if (empty($courseSetIds)) {
return array();
}
$marks = str_repeat('?,', count($courseSetIds) - 1).'?';
$parmaters = array_merge(array($copyId), $courseSetIds);
$sql = "SELECT * FROM {$this->table()} WHERE copyId= ? AND courseSetId IN ({$marks})";
return $this->db()->fetchAll($sql, $parmaters) ?: array();
}
public function getTestpaperByCopyIdAndCourseSetId($copyId, $courseSetId)
{
return $this->getByFields(array('copyId' => $copyId, 'courseSetId' => $courseSetId));
}
public function deleteByCourseSetId($courseSetId)
{
return $this->db()->delete($this->table(), array('courseSetId' => $courseSetId));
}
public function declares()
{
$declares = array(
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。