<?php
namespace App\Http\Model;

use Illuminate\Database\Eloquent\Model;
use App\Http\Response\Response;

/**
 * Class Account
 * @package App\Sports\Model
 * 赛事规则model
 */
class St_match_rule extends Model
{

    protected $table = 'st_match_rule';
    public $timestamps = false;

    /**
     * 获取赛事规则数据
     */
    function getList($limit = 0, $where = []){
        return  $this->select('id','group_id','group_name','author','atime','utime','status','modular_name')->where($where)
        ->limit($limit)
        ->get()
        ->toArray();

    }

    /**
     * 添加赛事规则
     */
    function addMatchRule($data){
        $res=$this->insert($data);
        if(!$res){
            return -6030001222;
        }
    }

    /**
     * 获取当前id规则
     */
    function getDmsg($id=0) {
		$data = $this->find($id);
		if (!$data) {
			return -4010010122; //没有数据
		}
		return $data->toArray();
    }

    //禁用操作
    public function closeGame($where,$data){
        return $this->where($where)->update($data);
    }
   
}