public function searchSchoolData(WindidSchoolSo $schoolSo, $limit = 10, $start = 0)
 {
     $params = $schoolSo->getData();
     $params['limit'] = $limit;
     $params['start'] = $start;
     return WindidApi::open('school/searchData', $params);
 }
 /**
  * 学校获取(typeid = 1:小学,2:中学,3:大学)
  */
 public function schoolAction()
 {
     list($type, $areaid, $name, $first) = $this->getInput(array('typeid', 'areaid', 'name', 'first'));
     !$type && ($type = 3);
     Wind::import('WINDID:service.school.vo.WindidSchoolSo');
     $schoolSo = new WindidSchoolSo();
     $schoolSo->setName($name)->setTypeid($type)->setFirstChar($first)->setAreaid($areaid);
     $list = WindidApi::api('school')->searchSchoolData($schoolSo, 1000);
     exit($list ? Pw::jsonEncode($list) : '');
 }
 /**
  * 学校获取(typeid = 1:小学,2:中学,3:大学)
  */
 public function schoolAction()
 {
     list($type, $areaid, $name, $first) = $this->getInput(array('typeid', 'areaid', 'name', 'first'));
     !$type && ($type = 3);
     Wind::import('WSRV:school.vo.WindidSchoolSo');
     $schoolSo = new WindidSchoolSo();
     $schoolSo->setName($name)->setTypeid($type)->setFirstChar($first)->setAreaid($areaid);
     /* @var $schoolService WindidSchoolService */
     $schoolService = Wekit::load('WSRV:school.srv.WindidSchoolService');
     $list = $schoolService->searchSchool($schoolSo, 1000);
     exit($list ? Pw::jsonEncode($list) : '');
 }
Example #4
0
 public function run()
 {
     list($type, $areaid, $name, $first) = $this->getInput(array('type', 'areaid', 'name', 'first'));
     !$type && ($type = 3);
     $schoolSo = new WindidSchoolSo();
     $schoolSo->setName($name)->setTypeid($type)->setFirstChar($first)->setAreaid($areaid);
     $list = array();
     $areaRoute = Wekit::load('area.srv.PwAreaService')->getAreaRout($areaid);
     $_rout = array('all' => array('disable' => 'li_disabled'), 'province' => array('areaid' => '', 'name' => '', 'display' => 'display:none;'), 'city' => array('areaid' => '', 'name' => '', 'display' => 'display:none;'), 'area' => array('areaid' => '', 'name' => '', 'display' => 'display:none;'));
     switch (count($areaRoute)) {
         case 1:
             $_rout['all']['disable'] = '';
             $_rout['province']['name'] = $areaRoute[0]['name'];
             $_rout['province']['areaid'] = $areaRoute[0]['areaid'];
             $_rout['province']['display'] = '';
             break;
         case 2:
             $_rout['all']['disable'] = '';
             $_rout['province']['name'] = $areaRoute[0]['name'];
             $_rout['province']['areaid'] = $areaRoute[0]['areaid'];
             $_rout['province']['display'] = '';
             $_rout['city']['name'] = $areaRoute[1]['name'];
             $_rout['city']['areaid'] = $areaRoute[1]['areaid'];
             $_rout['city']['display'] = '';
             break;
         case 3:
             $_rout['all']['disable'] = '';
             $_rout['province']['name'] = $areaRoute[0]['name'];
             $_rout['province']['areaid'] = $areaRoute[0]['areaid'];
             $_rout['province']['display'] = '';
             $_rout['city']['name'] = $areaRoute[1]['name'];
             $_rout['city']['areaid'] = $areaRoute[1]['areaid'];
             $_rout['city']['display'] = '';
             $_rout['area']['name'] = $areaRoute[2]['name'];
             $_rout['area']['areaid'] = $areaRoute[2]['areaid'];
             $_rout['area']['display'] = '';
         default:
             break;
     }
     if ($areaid) {
         $list = $this->_getDs()->searchSchool($schoolSo, 100);
     }
     $this->setOutput($list, 'list');
     $this->setOutput($schoolSo->getData(), 'data');
     $this->setOutput($_rout, 'route');
     $this->setOutput($type, 'type');
     $this->setOutput($this->type, 'schools');
 }
 public function searchDataAction()
 {
     $start = (int) $this->getInput('start', 'get');
     $limit = (int) $this->getInput('limit', 'get');
     $name = $this->getInput('name', 'get');
     $typeid = $this->getInput('typeid', 'get');
     $areaid = $this->getInput('areaid', 'get');
     $firstchar = $this->getInput('first_char', 'get');
     !$limit && ($limit = 10);
     !$start && ($start = 0);
     Wind::import('WINDID:service.school.vo.WindidSchoolSo');
     $schoolSo = new WindidSchoolSo();
     $schoolSo->setName($name)->setTypeid($typeid)->setFirstChar($firstchar)->setAreaid($areaid);
     $result = $this->_getSchoolService()->searchSchool($schoolSo, $limit, $start);
     $this->output($result);
 }
Example #6
0
 /**
  * 统计搜索结果
  *
  * @param WindidSchoolSo $schoolSo
  * @return int
  */
 public function countSearchSchool(WindidSchoolSo $schoolSo)
 {
     return $this->_getDao()->countSearchSchool($schoolSo->getData());
 }