Browse Source

充值送钱

shish 7 months ago
parent
commit
825dd29f30
1 changed files with 10 additions and 16 deletions
  1. 10 16
      app-hd/controllers/RechargeSqController.php

+ 10 - 16
app-hd/controllers/RechargeSqController.php

@@ -34,23 +34,17 @@ class RechargeSqController extends BaseController
 
     public function actionGetRechargeData()
     {
-        $shopId = $this->shopId;
-        $shop = $this->shop;
-        $rechargeWeal = $shop->rechargeWeal ?? 0;
-        if ($rechargeWeal == 1) {
-            $arr = [];
-            $weal = RechargeSqClass::getAllByCondition(['shopId' => $shopId], 'recharge asc', '*', null, true);
-            if (!empty($weal)) {
-                foreach ($weal as $key => $val) {
-                    $recharge = $val->recharge ?? 0;
-                    $recharge = floatval($recharge);
-                    $give = $val->give ?? 0;
-                    $give = floatval($give);
-                    $arr[] = ['recharge' => $recharge, 'give' => $give];
-                }
+        $mainId = $this->mainId;
+        $arr = [];
+        $weal = RechargeSqClass::getAllByCondition(['mainId' => $mainId], 'recharge asc', '*', null, true);
+        if (!empty($weal)) {
+            foreach ($weal as $key => $val) {
+                $recharge = $val->recharge ?? 0;
+                $recharge = floatval($recharge);
+                $give = $val->give ?? 0;
+                $give = floatval($give);
+                $arr[] = ['recharge' => $recharge, 'give' => $give];
             }
-        } else {
-            $arr = dict::getDict('rechargeMap');
         }
         util::success(['recharge' => $arr]);
     }