<?php
/**
 * Created by PhpStorm.
 * User: ikeke
 * Date: 2018/12/24
 * Time: 17:55
 */

namespace App\Models;


class Oggame_user extends BaseModel
{
    protected $table = "oggame_user";
    public $timestamps = false;

    public function getUser($username,$type)
    {
        $data = $this->where('lo_name', $username)->where('game_type', $type)->first();

        return $data;
    }

    public function getGameUser($username,$type)
    {
        $data = $this->where('rp_name', $username)->where('game_type', $type)->first();

        return $data;
    }

    public function insertUser($data)
    {
        $data = $this->insert($data);

        if(!$data)
        {
            return -1;
        }
        else
        {
            return 1;
        }
    }
}