post(); $result = validate('SysArticle')->check($data,[],''); if(true !== $result){ $this->error = validate('SysArticle')->getError(); return false; } $id = $data['id']; unset($data['id']); if($id > 0){ $ret = $this->allowField(true)->save($data,['id'=>$id]); }else{ $ret = $this->allowField(true)->save($data); } if(!$ret){ $this->error = '操作失败'; return false; } return true; } }