Updated dashboard
This commit is contained in:
@@ -35,18 +35,10 @@ class DashboardController extends Controller
|
||||
->groupBy('subscribe_plans.name', 'user_subscribers.market_provider')
|
||||
->get();
|
||||
|
||||
// Format the display name to show the source clearly
|
||||
// Dynamically format the display name using the provider directly from the DB
|
||||
$paidBreakdown->each(function ($item) {
|
||||
$provider = strtolower($item->market_provider ?? '');
|
||||
|
||||
if ($provider === 'bazar') {
|
||||
$item->display_name = $item->plan_name . ' (کافه بازار)';
|
||||
} elseif ($provider === 'myket') {
|
||||
$item->display_name = $item->plan_name . ' (مایکت)';
|
||||
} else {
|
||||
// If market_provider is null or empty, it was purchased directly from the site
|
||||
$item->display_name = $item->plan_name . ' (سایت / مستقیم)';
|
||||
}
|
||||
$provider = !empty($item->market_provider) ? $item->market_provider : 'سایت / مستقیم';
|
||||
$item->display_name = $item->plan_name . ' (' . $provider . ')';
|
||||
});
|
||||
|
||||
// Total paid is the sum of the breakdown
|
||||
|
||||
Reference in New Issue
Block a user