<?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 Admin\Model;
use Think\Model;

/**
 * 广告模型
 */
class AdModel extends Model{

    protected $_validate = array(
        array('title', 'require', 'Title cannot be empty', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
    );

    protected $_auto = array(
        array('create_time', NOW_TIME, self::MODEL_INSERT),
        array('update_time', NOW_TIME, self::MODEL_BOTH),
        array('status', '1', self::MODEL_BOTH),
    	array('mac_id', 'checkMac', 'Please select the machine', self::MUST_VALIDATE , 'callback', self::MODEL_BOTH),
    );


    /* 检查机柜编号 */
    public function checkMac($value){
    	return !empty($value);

    }



}
