You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
772 B
PHP

<?php
/**
* Created by PhpStorm.
* User: xmy 280564871@qq.com
* Date: 2017/4/26
* Time: 11:56
*/
namespace Open\Model;
class GameSetModel extends BaseModel{
/**
* 获取游戏参数
* @param $game_id
* @return mixed
* author: xmy 280564871@qq.com
*/
public function getGameParam($game_id){
$map['game_id'] = $game_id;
$data = $this->alias("s")->field("g.game_name,g.game_appid,s.*")->join("left join tab_game g on g.id = s.game_id")->where($map)->find();
return $data;
}
public function addSet($game_id){
$data['id'] = $data['game_id'] = $game_id;
//游戏密钥 MD5 16位加密4位随机数
$data['game_key'] = substr(md5(uniqid(1)),8,16);
//访问密钥
$data['access_key'] = substr(md5(uniqid(2)),8,16);
$this->add($data);
}
}