<?php

/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2018/8/20
 * Time: 10:42
 */

namespace App\Modules\RecommendBook\Services;

use App\Modules\BaseService;
use App\Modules\RecommendBook\Models\Recommend;

/**
 * @method static array getRecommendIdsStatic(int $channel, string $type)
 */
class RecommendService
{
    use BaseService;

    public function getRecommendIds(int $channel, string $type)
    {
        return Recommend::where([
            ['is_show', '=', 1],
            ['channel', '=', $channel],
            ['subject', '=', $type]
        ])->orderBy('sequence', 'asc')
            ->pluck('bid')
            ->all();
    }
}
