<?php

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

namespace App\Modules\RecommendBook\Services;

use App\Modules\RecommendBook\Models\QappRecommend;

class QappRecommendService
{
    public static function getRecommendByPacketId(int $channel, string $type, int $packet_id)
    {
        return QappRecommend::where([
            ['is_show', '=', 1],
            ['channel', '=', $channel],
            ['qapp_packet_id', '=', $packet_id],
            ['subject', '=', $type]
        ])->orderBy('sequence', 'asc')
            ->pluck('bid')
            ->all();
    }
}
