Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 3 лет назад
Родитель
Сommit
4c47e5f7d1
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      template/scripts/BxBaseDashboardServices.php

+ 2 - 2
template/scripts/BxBaseDashboardServices.php

@@ -68,12 +68,12 @@ class BxBaseDashboardServices extends BxDol
         $iProfileId = (int)bx_get_logged_profile_id();
         $iV1 = $bEmpty ? 0 : BxDolConnection::getObjectInstance('sys_profiles_friends')->getConnectedContentCount($iProfileId, true);
         $iV2 =$bEmpty ? 0 :  BxDolConnection::getObjectInstance('sys_profiles_friends')->getConnectedContentCount($iProfileId, true, $iStartDate);
-        $aData['friends'] = ['title' => 'Friends', 'key' => 'friends', 'type' => 'growth', 'url' =>'/friends', 'current' => $iV1, 'prev' => $iV2, 'growth' => $iV2 > 0 ? ($iV1 - $iV2)/$iV2*100 : 0];
+        $aData['friends'] = ['title' => 'Friends', 'key' => 'friends', 'type' => 'growth', 'url' =>'/friends', 'current' => $iV1, 'prev' => $iV2, 'growth' => $iV2 > 0 ? round(($iV1 - $iV2)/$iV2*100, 2) : 0];
        // echo $iV1.'----'.$iV2;
         
         $iV1 = $bEmpty ? 0 : BxDolConnection::getObjectInstance('sys_profiles_subscriptions')->getConnectedContentCount($iProfileId, false);
         $iV2 = $bEmpty ? 0 : BxDolConnection::getObjectInstance('sys_profiles_subscriptions')->getConnectedContentCount($iProfileId, false, $iStartDate);
-        $aData['followers'] = ['title' =>'Followers', 'key' => 'followers', 'type' => 'growth', 'url' =>'/followers', 'current' => $iV1, 'prev' => $iV2, 'growth' =>  $iV2 > 0 ? ($iV1 - $iV2)/$iV2*100 : 0];
+        $aData['followers'] = ['title' =>'Followers', 'key' => 'followers', 'type' => 'growth', 'url' =>'/followers', 'current' => $iV1, 'prev' => $iV2, 'growth' =>  $iV2 > 0 ? round(($iV1 - $iV2)/$iV2*100 ,2) : 0];
         
         $aModules = bx_srv('system', 'get_modules_by_type', ['content']);
         foreach($aModules as $aModule) {