wallet handling

This commit is contained in:
2026-06-15 11:25:10 +03:30
parent e9ddcacdb6
commit 81dfdbdb96
5 changed files with 30 additions and 22 deletions
@@ -42,9 +42,8 @@ class OrderController extends Controller
throw new UnprocessableEntityHttpException('امکان سفارش برای شما غیرفعال است.');
}
app(ConfigService::class)->assertTradingOpen();
$wallet = Wallet::where('owner',auth('customer')->id())->whereNull('fund_id')
->first();
$wallet_interface = new WalletInterface($data['customer_id'], 1);
$wallet_interface = new WalletInterface($data['customer_id'], (int) $customer->type);
$wallet = $wallet_interface->wallet;
if ($data['direction'] == 1){
// $order = Order::where('customer_id',auth('customer')->id())->where('sts',1)->first();
// if (!is_null($order)){