|
|
@@ -206,10 +206,15 @@ class Order extends ActiveRecordCommon |
|
|
|
*/ |
|
|
|
public function initPaidAmount() |
|
|
|
{ |
|
|
|
$history = CreditHistory::find() |
|
|
|
->where(['id_order' => $this->id]) |
|
|
|
->all(); |
|
|
|
|
|
|
|
if(isset($this->creditHistory)) { |
|
|
|
$history = $this->creditHistory ; |
|
|
|
} |
|
|
|
else { |
|
|
|
$history = CreditHistory::find() |
|
|
|
->where(['id_order' => $this->id]) |
|
|
|
->all(); |
|
|
|
} |
|
|
|
|
|
|
|
$this->paid_amount = 0 ; |
|
|
|
|
|
|
|
if(count($history)) { |
|
|
@@ -665,7 +670,9 @@ class Order extends ActiveRecordCommon |
|
|
|
if(is_array($orders)) { |
|
|
|
if(count($orders)) { |
|
|
|
foreach($orders as $order) { |
|
|
|
$order->init() ; |
|
|
|
if(is_a($order, 'common\models\Order')) { |
|
|
|
$order->init() ; |
|
|
|
} |
|
|
|
} |
|
|
|
return $orders ; |
|
|
|
} |