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); }
public function getAmphurs() { return @$this->hasOne(Amphur::className(), ['AMPHUR_ID' => 'province']); }
protected function getAmphur($id) { $datas = Amphur::find()->where(['PRV_CODE' => $id])->all(); return $this->MapData($datas, 'AMP_CODE', 'AMP_DESC'); }
protected function getAmphur($id) { $datas = Amphur::find()->where(['PROVINCE_ID' => $id])->all(); return $this->MapData($datas, 'AMPHUR_ID', 'AMPHUR_NAME'); }