Initial commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace Admin\Model;
|
||||
use Think\Model\RelationModel;
|
||||
class LinkModel extends RelationModel{
|
||||
//自动验证
|
||||
//array(验证字段,验证规则,错误提示,[验证条件,附加规则,验证时间])
|
||||
protected $_validate = array(
|
||||
array('name','require','请填写名称!',1),
|
||||
);
|
||||
//关联模型
|
||||
protected $_link = array(
|
||||
//对应栏目表
|
||||
"link_cat"=>array(
|
||||
'mapping_type' => self::BELONGS_TO,
|
||||
'foreign_key' => 'catid',
|
||||
)
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user