Ejemplo n.º 1
0
 /**
  * 获取疾病条数
  * @param type $diseaseQuery
  * @return type
  */
 public function getCounts($param)
 {
     $where = '';
     $bound = [];
     foreach ($param as $k => $v) {
         if (!empty($v)) {
             $where .= ' and ' . $k . ' = :' . $k;
             $bound[':' . $k] = $v;
         }
     }
     $where = substr($where, 5);
     $where = !empty($where) ? $where : '';
     return Department::find()->where($where, $bound)->count('id');
 }
 /**
  * ajax 获取二级科室
  */
 public function actionGetLevel2()
 {
     $class_level1 = $this->helpGpost('class_level1', '');
     $department = new Department();
     $level2 = $department->getLevel2ByLevel1($class_level1);
     return Json::encode($level2);
 }