Initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace Admin\Model;
|
||||
use Think\Model\RelationModel;
|
||||
class CraftTemplateModel extends RelationModel{
|
||||
|
||||
|
||||
//验证
|
||||
protected $_validate=array(
|
||||
//array("字段","验证规则","错误提示",["验证条件","附加条件","验证时间"]),
|
||||
array("template_name","require","参数模板名称不能为空"),
|
||||
|
||||
|
||||
);
|
||||
//保存信息
|
||||
public function data_save(){
|
||||
//创建数据
|
||||
$data=$this->create();
|
||||
$this->data($data)->save();
|
||||
return $data['template_id'];
|
||||
}
|
||||
//保存信息
|
||||
public function data_add(){
|
||||
//创建数据
|
||||
$data=$this->create();
|
||||
$id = $this->data($data)->add();
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user