andre 3 лет назад
Родитель
Сommit
407ab4a0da
1 измененных файлов с 7 добавлено и 9 удалено
  1. 7 9
      servicecode.php

+ 7 - 9
servicecode.php

@@ -1,4 +1,5 @@
 <?php
+use Illuminate\Database\Capsule\Manager as Capsule;
 
 // this hook returns $addon->subscriptionid as $addon.code in smarty
 
@@ -6,13 +7,10 @@ if (!defined("WHMCS"))
     die("This file cannot be accessed directly");
 
 add_hook('ClientAreaProductDetailsPreModuleTemplate', 1, function($vars) {
-
-    logModuleCall(
-        'ClientAreaProductDetailsPreModuleTemplate',
-        __FUNCTION__,
-        $vars,
-        'debug',
-        ''
-    );
-
+    foreach($vars['addons'] as $addon) {
+        $servicecode[$addon['id']] = Capsule::table('tblhostingaddons')
+            ->where('id', $addon['id'])
+            ->value('subscriptionid');
+    }
+    return array('servicecodes' => $servicecode);
 });