<?php


namespace app\models\bet;


use freedom\basic\BaseModel;
use freedom\traits\ModelTrait;

/**
 * TODO 洗码表Model
 * Class Bet
 * @package app\models\bet
 */
class Rebate extends BaseModel
{
    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';
    /**
     * 模型名称
     * @var string
     */
    protected $name = 'rebate';

    use ModelTrait;

    public static function getByNumberTabIdValid(int $numberTabId, string $field = '*'): array
    {
        $select = self::where(['number_tab_id' => $numberTabId])->field($field)->select();
        if (!empty($select)) return $select->toArray();
        else return [];
    }
}