|
|
@@ -21,6 +21,7 @@ class ReceiveAddressForm extends Model
|
|
|
public $id;
|
|
|
public $consignee;
|
|
|
public $mobile;
|
|
|
+ public $countryId;
|
|
|
public $province;
|
|
|
public $city;
|
|
|
public $county;
|
|
|
@@ -99,6 +100,7 @@ class ReceiveAddressForm extends Model
|
|
|
return $parentResult;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if ($this->id) {
|
|
|
$this->_model = ReceiveAddress::findOne(["ID"=>$this->id]);
|
|
|
if (!$this->_model){
|
|
|
@@ -112,6 +114,8 @@ class ReceiveAddressForm extends Model
|
|
|
} else {
|
|
|
$this->_model = new ReceiveAddress();
|
|
|
}
|
|
|
+
|
|
|
+ $this->countryId = Info::getUserCountryByUserId(\Yii::$app->user->id);
|
|
|
}
|
|
|
|
|
|
return $parentResult;
|
|
|
@@ -138,6 +142,7 @@ class ReceiveAddressForm extends Model
|
|
|
$this->_model->USER_NAME = Info::getUserNameByUserId(\Yii::$app->user->id);
|
|
|
$this->_model->CONSIGNEE = $this->consignee;
|
|
|
$this->_model->MOBILE = $this->mobile;
|
|
|
+ $this->_model->COUNTRY_ID = $this->countryId ?? Info::getUserCountryByUserId(\Yii::$app->user->id);
|
|
|
$this->_model->PROVINCE = $this->province;
|
|
|
$this->_model->LGA_NAME = $this->lgaName;
|
|
|
$this->_model->CITY_NAME = $this->cityName;
|
|
|
@@ -147,6 +152,7 @@ class ReceiveAddressForm extends Model
|
|
|
} elseif($this->scenario == 'userEdit') {
|
|
|
$this->_model->CONSIGNEE = $this->consignee;
|
|
|
$this->_model->MOBILE = $this->mobile;
|
|
|
+ $this->_model->COUNTRY_ID = $this->countryId ?? Info::getUserCountryByUserId(\Yii::$app->user->id);
|
|
|
$this->_model->PROVINCE = $this->province;
|
|
|
$this->_model->LGA_NAME = $this->lgaName;
|
|
|
$this->_model->CITY_NAME = $this->cityName;
|