public function saveAction()
 {
     //所有餐馆
     $restaurant = M('restaurant')->findAll();
     $this->assign('restaurant', $restaurant);
     //分类
     $cat = M('cat')->findAll();
     $this->assign('cat', $cat);
     parent::saveAction();
 }
 public function saveAction()
 {
     $department_id = fpBase('http')->getParam('department_id');
     if (!empty($department_id)) {
         $result = M('department')->find('pid=' . intval($department_id));
         if ($result) {
             exit(json_encode(array('statusCode' => 300, 'message' => '错误选择,选择的部门还有下级,请选择所在部门')));
         }
     }
     $password = fpBase('http')->getPost('password');
     if (!empty($password)) {
         $_POST['password'] = md5($password);
     }
     $dep = M('department')->getSelect(-1);
     $this->assign('dep', $dep);
     parent::saveAction();
 }
 public function saveAction()
 {
     if (fpBase('http')->isPost()) {
         $_POST['user_id'] = $this->userInfo['id'];
         $_POST['addtime'] = time();
     } else {
         //获取id
         $id = intval(fpBase('http')->getQuery('id'));
         $fast = M('fast')->find('id=' . $id);
         if (empty($fast)) {
             exit(json_encode(array('statusCode' => 300, 'message' => '请先点菜')));
         } else {
             $fast['restaurant_id'] = M('restaurant')->getName($fast['restaurant_id']);
             $fast['cat_id'] = M('cat')->getName($fast['cat_id']);
         }
         $this->assign('fast', $fast);
     }
     parent::saveAction();
 }
 public function saveAction()
 {
     $dep = M('department')->getSelect(0);
     $this->assign('dep', $dep);
     parent::saveAction();
 }