File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 5
5
use App \Abstracts \Job ;
6
6
use App \Utilities \Modules ;
7
7
use App \Models \Banking \Transaction ;
8
+ use App \Models \Banking \Transfer ;
8
9
9
10
class DeletePaymentMethod extends Job
10
11
{
@@ -75,11 +76,13 @@ public function getRelationships()
75
76
{
76
77
$ counter = [];
77
78
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 )) ;
80
81
}
81
82
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
+ }
83
86
84
87
return $ counter ;
85
88
}
Original file line number Diff line number Diff line change @@ -37,8 +37,6 @@ public function handle()
37
37
continue ;
38
38
}
39
39
40
- $ method = explode ('. ' , $ code );
41
-
42
40
$ payment_method = [
43
41
'code ' => $ code ,
44
42
'name ' => $ this ->request ->get ('name ' ),
You can’t perform that action at this time.
0 commit comments