src/Biz/Course/Dao/Impl/CourseLessonReplayDaoImpl.php

(开头部分) 2KB

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

<?php

namespace Biz\Course\Dao\Impl;

use Biz\Course\Dao\CourseLessonReplayDao;
use Codeages\Biz\Framework\Dao\GeneralDaoImpl;

class CourseLessonReplayDaoImpl extends GeneralDaoImpl implements CourseLessonReplayDao
{
    protected $table = 'course_lesson_replay';

    public function declares()
    {
        return array(
            'timestamps' => array('createdTime'),
            'orderbys' => array('replayId', 'createdTime'),
            'conditions' => array(
                'courseId = :courseId',
                'lessonId = :lessonId',
                'hidden = :hidden',
                'copyId = :copyId',
                'type = :type',
            ),
        );
    }

    public function deleteByLessonId($lessonId, $lessonType = 'live')
    {
        return $this->db()->delete($this->table, array('lessonId' => $lessonId, 'type' => $lessonType));
    }

    public function findByLessonId($lessonId, $lessonType = 'live')
    {
        $sql = "SELECT * FROM {$this->table()} WHERE lessonId = ? AND type = ? ORDER BY replayId ASC";

        return $this->db()->fetchAll($sql, array($lessonId, $lessonType));
    }

    public function deleteByCourseId($courseId, $lessonType = 'live')
    {
        return $this->db()->delete($this->table, array('courseId' => $courseId, 'type' => $lessonType));
    }

    public function getByCourseIdAndLessonId($courseId, $lessonId, $lessonType = 'live')
    {
        $sql = "SELECT * FROM {$this->table()} WHERE courseId=? AND lessonId = ? AND type = ? ";

        return $this->db()->fetchAssoc($sql, array($courseId, $lessonId, $lessonType));
    }

    public function findByCourseIdAndLessonId($courseId, $lessonId, $lessonType = 'live')
    {
        $sql = "SELECT * FROM {$this->table()} WHERE courseId=? AND lessonId = ? AND type = ? ";

        return $this->db()->fetchAll($sql, array($courseId, $lessonId, $lessonType));
    }

    public function updateByLessonId($lessonId, $lessonType = 'live', $fields)
    {
        return $this->db()->update($this->table, $fields, array('lessonId' => $lessonId, 'type' => $lessonType));

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

AI 解读 AI

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

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