<?php
namespace App\Models;
class PrizeLimit extends BaseModel
{

    protected $table="prize_limit";
    public $timestamps = false;
    //获取游戏单注最大金额信息列表
    function getGamebetMoney($game){
        $data=$this->select('id','game_name','min_money','max_money')->where('game_name',$game)->get();
        if(!$data){
            return -5040000401;//没有数据
        }
        $data=$data->toArray();
        foreach ($data as $k=>$v){
            $data[$k]['name']=trans('common.'.$v['game_name']);
        }
        return $data;
    }
    //设置开奖金额
    function setLimit($data,$game){
        if(($res=$this->has_game($game))){

        }
    }
    //检测游戏存在
    function has_game($game){
        $res=$this->where('game_name',$game)->first();
        if(!$res){
            return -5040000822;
        }
        return 1;
    }
}
