芝麻web文件管理V1.00
编辑当前文件:/home/rejoandoctor/medicine.joruridoctor.com/app/Http/Controllers/ReportController.php
query('date', Carbon::today()->toDateString()); // Fetch all products with their In quantities using Eloquent relationships $dailyReport = ProductModel::withWhereHas('productIn', function ($query) use ($date) { $query->whereDate('date', $date); }) ->withSum('productIn as quantity_in', 'qty') ->get(['id', 'product_name']); return view('admin.dailyInReport', compact('dailyReport')); } public function dailyProductOutReport(Request $request) { $date = $request->query('date', Carbon::today()->toDateString()); // Fetch all products with their In quantities using Eloquent relationships $dailyReport = ProductModel::withWhereHas('productOut', function ($query) use ($date) { $query->whereDate('date', $date); }) ->withSum('productOut as quantity_out', 'qty') ->get(['id', 'product_name']); return view('admin.dailyOutReport', compact('dailyReport')); } }