1、修复栏目管理中的bug
2、增加路由规则管理
This commit is contained in:
@@ -25,6 +25,10 @@ class Base extends \think\Model{
|
||||
*/
|
||||
public function change(){
|
||||
$data = \think\Request::instance()->post();
|
||||
return $this->save($data, array('id'=>$data['id']));
|
||||
if (isset($data['id']) && $data['id']) {
|
||||
return $this->save($data, array('id'=>$data['id']));
|
||||
}else{
|
||||
return $this->save($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ class Document extends \think\model\Merge{
|
||||
protected $fk = 'doc_id';
|
||||
|
||||
// 定义需要自动写入时间戳格式的字段
|
||||
protected $autoTimeField = array('create_time','update_time','deadline');
|
||||
protected $autoWriteTimestamp = array('create_time','update_time','deadline');
|
||||
|
||||
protected $auto = array('doc_id', 'title', 'description', 'update_time','deadline');
|
||||
protected $insert = array('uid', 'attach'=>0, 'view'=>0, 'comment'=>0, 'extend'=>0, 'create_time', 'status');
|
||||
|
||||
@@ -14,8 +14,24 @@ namespace app\common\model;
|
||||
*/
|
||||
class Rewrite extends Base{
|
||||
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
public $keyList = array(
|
||||
array('name'=>'id','title'=>'标识','type'=>'hidden'),
|
||||
array('name'=>'title','title'=>'规则名称','type'=>'text','option'=>'','help'=>'规则名称,方便记忆'),
|
||||
array('name'=>'rule','title'=>'规则名称','type'=>'text','option'=>'','help'=>'规则名称,方便记忆'),
|
||||
array('name'=>'url','title'=>'规则地址','type'=>'text','option'=>'','help'=>'规则地址'),
|
||||
);
|
||||
|
||||
/**
|
||||
* 数据修改
|
||||
* @return [bool] [是否成功]
|
||||
*/
|
||||
public function change(){
|
||||
$data = \think\Request::instance()->post();
|
||||
if (isset($data['id']) && $data['id']) {
|
||||
return $this->validate(true)->save($data, array('id'=>$data['id']));
|
||||
}else{
|
||||
return $this->validate(true)->save($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user