To adjust the query to accommodate transactions where the status_id is either 1 or 6, you can use the whereIn method provided by Laravel's Query Builder. This method allows you to specify an array of values that the status_id column must match. Here's how you can modify the getTransactionAggregates method in your controller to include this logic: namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; class TransactionController extends Controller { public function getTransactionAggregates($user_id, Request $request) { $startDate = $request->query('startDate'); $endDate = $request->query('endDate'); $transactionAggregates = DB::table('reports') ->where('reports.user_id', $user_id) ->join('providers', 'reports.provider_id', '=', 'providers.id') ->whereBetween('reports.created_at...
Comments
Post a Comment