浏览代码

fix overview credit erarnings

1day2die 2 年之前
父节点
当前提交
da29ead3cd

+ 2 - 1
app/Http/Controllers/Admin/OverViewController.php

@@ -173,7 +173,8 @@ class OverViewController extends Controller
             $nodeId = $server['attributes']['node'];
             $nodeId = $server['attributes']['node'];
 
 
             if ($CPServer = Server::query()->where('pterodactyl_id', $server['attributes']['id'])->first()) {
             if ($CPServer = Server::query()->where('pterodactyl_id', $server['attributes']['id'])->first()) {
-                $price = Product::query()->where('id', $CPServer->product_id)->first()->price;
+                $product = Product::query()->where('id', $CPServer->product_id)->first();
+                $price = $product->getMonthlyPrice();
                 if (! $CPServer->suspended) {
                 if (! $CPServer->suspended) {
                     $counters['earnings']->active += $price;
                     $counters['earnings']->active += $price;
                     $counters['servers']->active++;
                     $counters['servers']->active++;

+ 1 - 1
themes/default/views/admin/overview/index.blade.php

@@ -240,7 +240,7 @@
                                     <th>{{__('Node')}}</th>
                                     <th>{{__('Node')}}</th>
                                     <th>{{__('Server count')}}</th>
                                     <th>{{__('Server count')}}</th>
                                     <th>{{__('Resource usage')}}</th>
                                     <th>{{__('Resource usage')}}</th>
-                                    <th>{{ $credits_display_name . ' ' . __('Usage')}}</th>
+                                    <th>{{ $credits_display_name . ' ' . __('Usage') ." (".__('per month').")"}}</th>
                                 </tr>
                                 </tr>
                                 </thead>
                                 </thead>
                                 <tbody>
                                 <tbody>