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

(开头部分) 1KB

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

<?php

namespace Biz\Course\Dao\Impl;

use Biz\Course\Dao\FavoriteDao;
use Biz\Course\Dao\CourseSetDao;
use Biz\Course\Dao\CourseDao;
use Codeages\Biz\Framework\Dao\GeneralDaoImpl;

class FavoriteDaoImpl extends GeneralDaoImpl implements FavoriteDao
{
    protected $table = 'course_favorite';

    public function declares()
    {
        return array(
            'timestamps' => array('createdTime'),
            'orderbys' => array('replayId', 'createdTime', 'id'),
            'conditions' => array(
                'courseId = :courseId',
                'userId = :userId',
                'type = :type',
                'createdTime >= :createdTime_GE',
                'courseSetId = :courseSetId',
                'courseSetId IN ( :courseSetIds )',
                'courseId NOT IN ( :excludeCourseIds )',
            ),
        );
    }

    public function getByUserIdAndCourseId($userId, $courseId, $type = 'course')
    {
        return $this->getByFields(array('userId' => $userId, 'courseId' => $courseId, 'type' => $type));
    }

    public function searchByUserId($userId, $start, $limit)
    {
        return $this->search(
            array(
                'userId' => $userId,
            ),
            array('createdTime' => 'DESC'),
            $start,
            $limit
        );
    }

    public function getByUserIdAndCourseSetId($userId, $courseSetId, $type = 'course')
    {
        return $this->getByFields(array(
            'userId' => $userId,
            'courseSetId' => $courseSetId,
            'type' => $type,
        ));
    }

    /*
     * 2017/3/1 为移动端提供服务,其他慎用
     */
    public function findCourseFavoritesNotInClassroomByUserId($userId, $start, $limit)

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

AI 解读 AI

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

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