add feature payout_later
This commit is contained in:
@@ -960,7 +960,7 @@ class Transfer extends \common\models\BaseFitnessActiveRecord {
|
||||
ShoppingCart::deleteAll(['id_transfer' => $this->id_transfer]);
|
||||
UserSoldItem::deleteAll(['id_transfer' => $this->id_transfer]);
|
||||
}
|
||||
public function payout() {
|
||||
public function payout($id_account = null) {
|
||||
|
||||
if ($this->status != Transfer::STATUS_NOT_PAID) {
|
||||
return false;
|
||||
@@ -970,14 +970,18 @@ class Transfer extends \common\models\BaseFitnessActiveRecord {
|
||||
$this->paid_at = Helper::getDateTimeString ();
|
||||
$this->paid_by = \Yii::$app->user->id;
|
||||
|
||||
if( Helper::isUserCartVisibilityAll() ){
|
||||
$this->id_account = Account::readDefault();
|
||||
if ( isset($id_account)){
|
||||
$this->id_account = $id_account;
|
||||
}else{
|
||||
if( Helper::isUserCartVisibilityAll() ){
|
||||
$this->id_account = Account::readDefault();
|
||||
}
|
||||
}
|
||||
|
||||
ShoppingCart::deleteAll ( [ 'id_transfer' => $this->id_transfer ] );
|
||||
UserSoldItem::deleteAll ( [ 'id_transfer' => $this->id_transfer
|
||||
] );
|
||||
return $this->save ();
|
||||
return $this->save (false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user