コード例 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDistrict()
 {
     return $this->hasOne(RgnDistrict::className(), ['id' => 'district_id']);
 }
コード例 #2
0
 /**
  * Provide data for Depdrop options
  * @param type $selected
  *
  * @return mixed
  */
 public function actionDepdropOptions($selected = 0)
 {
     echo \common\helpers\DepdropHelper::getOptionData(['modelClass' => RgnDistrict::className(), 'parents' => ['city_id' => function ($value) {
         return $value > 0 ? $value : "";
     }], 'filter' => ['recordStatus' => RgnDistrict::RECORDSTATUS_USED], 'selected' => $selected]);
 }
コード例 #3
0
ファイル: RgnCity.php プロジェクト: fredyns/yii2-boilerplate
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getRgnDistricts()
 {
     return $this->hasMany(RgnDistrict::className(), ['city_id' => 'id'])->andFilterWhere(['like', 'recordStatus', RgnDistrict::RECORDSTATUS_USED]);
 }
コード例 #4
0
ファイル: RgnCity.php プロジェクト: AlvaCorp/yii2-boilerplate
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getRgnDistricts()
 {
     return $this->hasMany(RgnDistrict::className(), ['city_id' => 'id'])->andFilterWhere(['like', 'status', RgnDistrict::STATUS_ACTIVE]);
 }
コード例 #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDistrict()
 {
     return $this->hasOne(\frontend\models\RgnDistrict::className(), ['id' => 'district_id']);
 }