From 79852501a6cef1904f1d0565a8e1b9f15e178dfc Mon Sep 17 00:00:00 2001 From: liqi Date: Tue, 11 Mar 2025 14:42:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/forms/LedgerForm.php | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/common/forms/LedgerForm.php b/common/forms/LedgerForm.php index 3f5a92e..97b1246 100644 --- a/common/forms/LedgerForm.php +++ b/common/forms/LedgerForm.php @@ -192,12 +192,19 @@ class LedgerForm extends BaseModel $totalBuyPrice = round($number * $v['buy_price'], 4); if ($productOrder['prescription']['category'] == 2) { - (new MonthlyPaymentModel)->save([ - 'store_id' => $productOrder->store_id, - 'order_id' => $productOrder->id, - 'amount' => $totalBuyPrice, - 'created_at' => $time, - ]); + $model = new MonthlyPaymentModel(); + $model->store_id = $productOrder->store_id; + $model->order_id = $productOrder->id; + $model->amount = $totalBuyPrice; + $model->created_at = $time; + $model->save(); + +// (new MonthlyPaymentModel)->save([ +// 'store_id' => $productOrder->store_id, +// 'order_id' => $productOrder->id, +// 'amount' => $totalBuyPrice, +// 'created_at' => $time, +// ]); } else { $ledger[] = [ @@ -246,12 +253,18 @@ class LedgerForm extends BaseModel $totalPrice = round($v['number'] * $v['price'], 4); $totalBuyPrice = round($v['number'] * $v['buy_price'], 4); if ($productOrder['prescription']['category'] == 2) { - (new MonthlyPaymentModel)->save([ - 'store_id' => $productOrder->store_id, - 'order_id' => $productOrder->id, - 'amount' => $totalBuyPrice, - 'created_at' => $time, - ]); +// (new MonthlyPaymentModel)->save([ +// 'store_id' => $productOrder->store_id, +// 'order_id' => $productOrder->id, +// 'amount' => $totalBuyPrice, +// 'created_at' => $time, +// ]); + $model = new MonthlyPaymentModel(); + $model->store_id = $productOrder->store_id; + $model->order_id = $productOrder->id; + $model->amount = $totalBuyPrice; + $model->created_at = $time; + $model->save(); } else { $ledger[] = [ 'order_id' => $this->order_id,