Ejemplo n.º 1
0
 /**
  * 获取省份列表
  */
 public function provinceAction()
 {
     if ($this->getParam('provinceList')) {
         $province_ids = explode(',', $this->getParam('provinceList'));
         $mod = new Application_Model_City();
         $rows = $mod->select()->setWhereIn('city_id', $province_ids)->setLimit(false)->fetchAll();
     } else {
         $mod = new Application_Model_City();
         $rows = $mod->getsByProvince();
     }
     $tmp = '';
     if ($rows != false) {
         foreach ($rows as $row) {
             $tmp[] = array('id' => $row->city_id, 'name' => $row->name, 'first_letter' => $row->first_letter, 'py' => $row->pinyin);
         }
     }
     $this->responseOK($tmp);
 }