Skip to content

Commit ad50871

Browse files
committed
Delete method check transfer item.
1 parent c704281 commit ad50871

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Jobs/DeletePaymentMethod.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Abstracts\Job;
66
use App\Utilities\Modules;
77
use App\Models\Banking\Transaction;
8+
use App\Models\Banking\Transfer;
89

910
class DeletePaymentMethod extends Job
1011
{
@@ -75,11 +76,13 @@ public function getRelationships()
7576
{
7677
$counter = [];
7778

78-
if (!$c = Transaction::where('payment_method', $this->request->get('code'))->get()->count()) {
79-
return [];
79+
if ($transaction_count = Transaction::where('payment_method', $this->request->get('code'))->count()) {
80+
$counter[] = $transaction_count . ' ' . strtolower(trans_choice('general.transactions', ($transaction_count > 1) ? 2 : 1));
8081
}
8182

82-
$counter[] = $c . ' ' . strtolower(trans_choice('general.transactions', ($c > 1) ? 2 : 1));
83+
if ($transfer_count = Transfer::where('payment_method', $this->request->get('code'))->count()) {
84+
$counter[] = $transfer_count . ' ' . strtolower(trans_choice('general.transfers', ($transfer_count > 1) ? 2 : 1));
85+
}
8386

8487
return $counter;
8588
}

Jobs/UpdatePaymentMethod.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ public function handle()
3737
continue;
3838
}
3939

40-
$method = explode('.', $code);
41-
4240
$payment_method = [
4341
'code' => $code,
4442
'name' => $this->request->get('name'),

0 commit comments

Comments
 (0)