public function insert() { $article = new GonggaoModel(); if ($data = $article->create()) { if (false !== $article->add()) { $this->message('添加成功', __URL__ . '/index'); } else { $this->message('添加失败:' . $article->getError(), __URL__ . '/add'); } } else { $this->message('添加失败:' . $article->getError(), __URL__ . '/add'); } }