<?php
// +----------------------------------------------------------------------
// | OpenCMF [ Simple Efficient Excellent ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014 http://www.opencmf.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: mzc
// +----------------------------------------------------------------------
namespace Admin\Model;
use Think\Model;
/**
* 管理员与用户组对应关系模型
* @author mzc <598821125@qq.com>
*/
class BusinessModel extends Model {
/**
* 数据库表名
* @author mzc
*/
protected $trueTableName = 'cy_business';
/**
* 自动验证规则
* @author mzc
*/
protected $_validate = array(
array('gamename', 'require', '游戏名称不能为空'),
array('cpinfo', 'require', '发行商不能为空'),
array('gamename','','游戏已经存在!',0,'unique',3),
);
}
参考:http://document.thinkphp.cn/manual_3_2.html#auto_validate
tp3.2 模型验证规则
最新推荐文章于 2018-11-03 12:32:07 发布