fix some bugs 2
This commit is contained in:
@@ -172,7 +172,13 @@ class WalletController extends Controller
|
|||||||
$record->title = $record->type_str;
|
$record->title = $record->type_str;
|
||||||
$record->unit = "گرم";
|
$record->unit = "گرم";
|
||||||
|
|
||||||
if (isset($record->wallet)) {
|
if ((int) ($record->type ?? 0) === 22) {
|
||||||
|
$record->title = 'تعدیل مانده پرگار';
|
||||||
|
$record->unit = 'گرم';
|
||||||
|
} elseif ((int) ($record->type ?? 0) === 12) {
|
||||||
|
$record->title = 'برداشت وجه نقد';
|
||||||
|
$record->unit = 'ریال';
|
||||||
|
} elseif (isset($record->wallet)) {
|
||||||
$wallet = Wallet::with('product')->where('id', $record->wallet)->first();
|
$wallet = Wallet::with('product')->where('id', $record->wallet)->first();
|
||||||
|
|
||||||
if (isset($wallet->product)) {
|
if (isset($wallet->product)) {
|
||||||
@@ -192,7 +198,9 @@ class WalletController extends Controller
|
|||||||
$record->title = $record->type_str;
|
$record->title = $record->type_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
$record->save();
|
if (!empty($record->title) && $record->title !== 'تعریف نشده') {
|
||||||
|
$record->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->applyAbshodeProductTransactionTitle($record);
|
$this->applyAbshodeProductTransactionTitle($record);
|
||||||
@@ -785,6 +793,14 @@ class WalletController extends Controller
|
|||||||
return self::mainMetalWithdrawTitle();
|
return self::mainMetalWithdrawTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((int) $record->type === 12) {
|
||||||
|
return 'برداشت وجه نقد';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((int) $record->type === 22) {
|
||||||
|
return 'تعدیل مانده پرگار';
|
||||||
|
}
|
||||||
|
|
||||||
return $record->type_str;
|
return $record->type_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -285,6 +285,7 @@ class PargarInboundController extends Controller
|
|||||||
new TransactionInterface($walletInterface, [
|
new TransactionInterface($walletInterface, [
|
||||||
'cash' => $rialDiff,
|
'cash' => $rialDiff,
|
||||||
'gold' => $goldDiff,
|
'gold' => $goldDiff,
|
||||||
|
'title' => 'تعدیل مانده پرگار',
|
||||||
'expire_at' => now(),
|
'expire_at' => now(),
|
||||||
'active' => true,
|
'active' => true,
|
||||||
'start_at' => now(),
|
'start_at' => now(),
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ class Transaction extends Model
|
|||||||
8 => ' پاداش بابت معرفی',
|
8 => ' پاداش بابت معرفی',
|
||||||
9 => 'سود زیر مجموعه',
|
9 => 'سود زیر مجموعه',
|
||||||
10 => 'برداشت طلایی',
|
10 => 'برداشت طلایی',
|
||||||
|
12 => 'برداشت وجه نقد',
|
||||||
|
22 => 'تعدیل مانده پرگار',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user