added merge wallet

This commit is contained in:
2026-06-10 16:57:31 +03:30
parent bb94f7a5ba
commit 285767fcd3
5 changed files with 202 additions and 10 deletions
@@ -74,10 +74,13 @@ class CustomerController extends SuperController
public function funds(Request $request,$customer_id)
{
$query_table = Wallet::with(['fund'])->where('owner', $customer_id); // Adjust columns as per your schema
// فقط کیف محصول‌ها (نه کیف اصلی) — هر ردیف = موجودی واقعی یک محصول/فلز
$query_table = Wallet::with(['product:id,title,metal_id,unit'])
->where('owner', $customer_id)
->whereNotNull('product_id');
TableEngine::create($query_table, $request)
->initSearch($this->search)
->select(['id', 'owner', 'cash', 'gold','fund_id','created_at', 'updated_at'])
->select(['id', 'owner', 'cash', 'gold', 'fund_id', 'product_id', 'created_at', 'updated_at'])
->export($query_table);
return response()->json($query_table);
}