예제 #1
0
 /**
  * 单元   新单元插入数据库
  */
 function insert()
 {
     $section = new SectionModel();
     //如果数据压入成功
     if (($data = $section->create()) !== false) {
         if ($section->add()) {
             $this->assign('jumpUrl', __URL__ . '/index');
             $this->success('添加新单元成功');
         } else {
             $this->assign('jumpUrl', __URL__ . '/index');
             $this->error('添加新单元失败' . $section->getError());
         }
     } else {
         $this->assign('jumpUrl', __URL__ . '/index');
         $this->error('添加失败' . $section->getError());
     }
 }