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.

43 lines
1.5 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
namespace Home\Model;
/**
* 分类模型
*/
class SiteServerModel extends SiteModel{
protected $_validate = array(
array('game_id', 'require', '游戏不能为空', self::EXISTS_VALIDATE, 'regex', self::MODEL_BOTH),
array('server_name', 'require', '区服名称不能为空', self::EXISTS_VALIDATE, 'regex', self::MODEL_BOTH),
array('start_time', 'require', '开服时间不能为空', self::EXISTS_VALIDATE, 'regex', self::MODEL_BOTH),
);
protected $_auto = array(
array('create_time', NOW_TIME, self::MODEL_INSERT),
array('promote_id', PID, self::MODEL_BOTH),
array('server_id', 0, self::MODEL_INSERT),
array('start_time',"strtotime",self::MODEL_BOTH,'function')
);
/**
* 获取站点信息
* @param int $promote_id
* @return mixed
*/
public function get_promote_data($promote_id=PID){
$map['promote_id'] = $promote_id;
$map['status'] = 1;
$data = $this->where($map)->find();
return $data;
}
}