fix bug 4
This commit is contained in:
@@ -507,6 +507,15 @@ class WalletController extends Controller
|
||||
], 422);
|
||||
}
|
||||
|
||||
$requestValue = (float) $data['wallets'][$key]['value'];
|
||||
if (Controller::isCountBasedProduct(Controller::productUnitPayload($walletProduct))) {
|
||||
if (abs($requestValue - round($requestValue)) > 0.000001) {
|
||||
return response()->json([
|
||||
'message' => "برای {$walletProduct['title']} فقط تعداد صحیح مجاز است"
|
||||
], 422);
|
||||
}
|
||||
$data['wallets'][$key]['value'] = (int) round($requestValue);
|
||||
}
|
||||
|
||||
$data['wallets'][$key]['wallet_interface'] = new WalletInterface(auth('customer')->id(), auth('customer')->user()->type, null, $effectiveProductId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user