fix some bugs
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Models\Customer;
|
||||
use App\Models\Order;
|
||||
use App\Models\Price;
|
||||
use App\Models\Setting;
|
||||
use App\Services\WalletBalanceService;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\UnprocessableEntityHttpException;
|
||||
|
||||
@@ -37,10 +38,7 @@ class OrderController extends Controller
|
||||
|
||||
$lastPrice = (float) (Price::latest('created_at')->value('price') ?? 0);
|
||||
|
||||
$mainWallet = $customer->wallet->first(
|
||||
fn ($wallet) => is_null($wallet->product_id) && is_null($wallet->fund_id)
|
||||
) ?? $customer->wallet->first();
|
||||
$goldAmount = (float) ($mainWallet->gold ?? 0);
|
||||
$goldAmount = app(WalletBalanceService::class)->effectiveMainWalletGold((int) $customerId);
|
||||
|
||||
$orders = Order::query()
|
||||
->where('customer_id', $customerId)
|
||||
|
||||
Reference in New Issue
Block a user