added merge wallet
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user