<?php
namespace App\Models;

use DB;

/**
 * 赛事种类 Model
 */
class StGameType extends BaseModel
{
    // 表名
    protected $table = "st_game_type";

    /**
     * 获取所有赛事种类
     *
     * @access public
     * @param mixed $select 查询参数
     * @param mixed $where 查询条件
     * @param mixed $orderBy 排序字段
     * @return array JsonString
     */
    public function getGameType($select, $where, $orderBy = 'id') {
        if ($where) {
            $result = $this -> select($select)
                -> where($where)
                -> orderBy($orderBy)
                -> get();
        } else {
            $result = $this -> select($select)
                -> orderBy($orderBy)
                -> get();
        }

        return $result;
    }
}
