www.legu.cc/plugins/Demo/Model/PluginDemoModel.class.php
2021-09-06 11:50:33 +08:00

27 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2014 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
namespace plugins\Demo\Model;//Demo插件英文名改成你的插件英文就行了
use Common\Model\CommonModel;//继承CommonModel
class PluginDemoModel extends CommonModel{ //Demo插件英文名改成你的插件英文就行了,插件数据表最好加个plugin前缀再加表名,这个类就是对应“表前缀+plugin_demo”表
//自动验证
protected $_validate = array(
//array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
//array('ad_name', 'require', '广告名称不能为空!', 1, 'regex', 3),
);
protected function _before_write(&$data) {
parent::_before_write($data);
}
//自定义方法
function test(){
echo "hello";
}
}