Fix BadMethodCallException and remaining PostgreSQL issues
This commit is contained in:
@@ -34,8 +34,9 @@ public function getDashboardData()
|
||||
public function yearlySubscriptions()
|
||||
{
|
||||
$subscriptions = PlanSubscribe::whereYear('created_at', request('year') ?? date('Y'))
|
||||
->selectRaw("TO_CHAR(created_at, 'Month') as month, SUM(price) as total_amount")
|
||||
->groupBy('month')
|
||||
->selectRaw("TO_CHAR(created_at, 'FMMonth') as month, SUM(price) as total_amount")
|
||||
->groupBy(DB::raw("TO_CHAR(created_at, 'FMMonth')"))
|
||||
->orderBy(DB::raw("MIN(created_at)"))
|
||||
->get();
|
||||
|
||||
return response()->json($subscriptions);
|
||||
|
||||
Reference in New Issue
Block a user