public function categoryAction()
 {
     $categorys = Application_Model_M_ConsultationDepartmentsCategory::fetchByStatus(1);
     if (count($categorys) > 0) {
         $out['errno'] = '0';
         $results = array();
         foreach ($categorys as $category) {
             $result = array('id' => $category->getId(), 'name' => $category->getName());
             array_push($results, $result);
         }
         $out['categorys'] = $results;
     } else {
         $out['errno'] = '1';
     }
     $out['msg'] = Yy_ErrMsg_Department::getMsg('category', $out['errno']);
     Yy_Utils::jsonOut($out);
 }
 public function delete()
 {
     $where = 'id=' . $this->getId();
     return Application_Model_M_ConsultationDepartmentsCategory::delete($where);
 }
Beispiel #3
0
 public static function getConsultationDepartmentsCategoryNameByCID($cid)
 {
     $str = "";
     $cdcate = Application_Model_M_ConsultationDepartmentsCategory::find($cid);
     if ($cdcate) {
         $str = $cdcate->getName();
     }
     return $str;
 }
 public function departcateupdateAction()
 {
     $id = $this->_getParam('id');
     $cate = Application_Model_M_ConsultationDepartmentsCategory::find($id);
     if ($cate) {
         $this->view->cate = $cate;
     } else {
         $this->redirect('error');
     }
 }