update email template

This commit is contained in:
baodev0
2026-09-09 16:56:22 +07:00
parent d3d9f76ba0
commit 2365ef72e9
210 changed files with 6335 additions and 4688 deletions
+9 -9
View File
@@ -57,15 +57,15 @@ class GetTransactionPayment implements ShouldQueue
foreach ($history as $item) {
if (empty($item->tracingType) && str_contains($item['description'], $this->message)) {
$transaction = str_replace("\\BNK", "", $item['refNo']);
$transCheck = Transaction::where('trans', $transaction)->first();
if (!$transCheck) {
Transaction::create(
[
'trans' => $transaction,
'amount' => (int)$item['creditAmount'] ,
'customer_id' => $this->user
]
);
// firstOrCreate is atomic against the unique(customer_id, trans, type) index —
// a duplicate bank-statement poll (job retried, matched twice) cannot credit twice.
$created = Transaction::firstOrCreate(
['trans' => $transaction, 'customer_id' => $this->user],
['amount' => (int) $item['creditAmount']]
);
if ($created->wasRecentlyCreated) {
Customer::find($this->user)->increment('credit', (int)$item['creditAmount']);
Customer::find($this->user)->increment('total', (int)$item['creditAmount']);