fix profit value after each order

This commit is contained in:
2026-07-18 16:38:46 +03:30
parent 45f2d8bf70
commit b66cd5e8f9
5 changed files with 56 additions and 6 deletions
@@ -158,9 +158,13 @@ class ProductController extends SuperController
public function show($id){
$customer = auth('customer')->user();
$assetSummaryService = app(AssetSummaryService::class);
$query = Product::/*with(['walletMy as wallet'])->*/findOrFail($id);
$query = Product::with('file')->findOrFail($id);
$wallet = $query->walletMy;
if ($query->relationLoaded('file') && $query->file) {
$query->file->setAttribute('full_src', $query->file->src);
}
// محصول متصل به کیف اصلی: موجودی مؤثر (کیف اصلی + legacy) — نه فقط ردیف product handle
if (self::isMainWalletProduct((int) $id)) {
$mainWalletGold = $assetSummaryService->productDisplayQuantity(