示例#1
0
 public function amphur()
 {
     $result = Amphur::where('PROVINCE_ID', Input::get('id'))->select('AMPHUR_ID', 'AMPHUR_NAME')->get();
     $dropdown = '<option value=""></option>';
     foreach ($result as $result) {
         $dropdown .= '<option value="' . $result->AMPHUR_ID . '">' . $result->AMPHUR_NAME . '</option>';
     }
     return Response::make($dropdown);
 }
示例#2
0
 public function getAmphurs()
 {
     return @$this->hasOne(Amphur::className(), ['AMPHUR_ID' => 'province']);
 }
示例#3
0
 protected function getAmphur($id)
 {
     $datas = Amphur::find()->where(['PRV_CODE' => $id])->all();
     return $this->MapData($datas, 'AMP_CODE', 'AMP_DESC');
 }
示例#4
0
 protected function getAmphur($id)
 {
     $datas = Amphur::find()->where(['PROVINCE_ID' => $id])->all();
     return $this->MapData($datas, 'AMPHUR_ID', 'AMPHUR_NAME');
 }