public function getDista() { //relation อำเภอไปตำบล return $this->hasMany(Districts::className(), ['AMPHUR_ID' => 'AMPHUR_ID']); }
protected function getDist($id) { $datas = Districts::find()->where(['AMPHUR_ID' => $id])->all(); return $this->MapData($datas, 'DISTRICT_ID', 'DISTRICT_NAME'); }
public function getDistict() { return $this->hasOne(Districts::className(), ['DISTRICT_ID' => 'tumbon']); }
public function getDistp() { //relation จังหวัดไปตำบล return $this->hasMany(Districts::className(), ['PROVINCE_ID' => 'PROVINCE_ID']); }