shish пре 1 година
родитељ
комит
67bd8e5b11

+ 38 - 0
app-hd/controllers/BalanceChangeController.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace hd\controllers;
+
+use Yii;
+
+class BalanceChangeController extends BaseController
+{
+
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $export = $get['export'] ?? 0;
+        $where = [];
+        $where['mainId'] = $this->mainId;
+        $searchTime = $get['searchTime'] ?? '';
+        if (!empty($searchTime)) {
+            $startTime = $get['startTime'] ?? '';
+            $endTime = $get['endTime'] ?? '';
+            $period = dateUtil::formatTime($searchTime, $startTime, $endTime);
+            $where['addTime'] = ['between', [$period['startTime'], $period['endTime']]];
+        } else {
+            if ($export == 1) {
+                util::fail('请选择时间');
+            }
+        }
+
+        $customId = $get['customId'] ?? 0;
+        if (!empty($customId)) {
+            $custom = CustomClass::getById($customId);
+            CustomClass::valid($custom, $this->shopId);
+            $where['customId'] = $customId;
+        }
+        $respond = CustomBalanceChangeClass::getChangeList($where);
+        util::success($respond);
+    }
+
+}

+ 8 - 2
app-hd/controllers/RechargeController.php

@@ -77,14 +77,12 @@ class RechargeController extends BaseController
             'orderSn' => $orderSn,
             'modPrice' => 1,
             'payWay' => $payWay,
-            'returnCode' => '',
             'shopId' => $shopId,
             'mainId' => $mainId,
             'hdId' => $hdId,
             'hdName' => $hdName,
             'onlinePay' => 1,
             'amount' => $amount,
-            'balance' => '',
             'staffId' => $staffId,
             'staffName' => $staffName,
             'payStatus' => 0,
@@ -96,6 +94,14 @@ class RechargeController extends BaseController
         ];
         $respond = \bizHd\recharge\classes\RechargeClass::addRecharge($rechargeData);
 
+        $id = $respond->id;
+        $recharge = RechargeClass::getLockById($id);
+        $params = [
+            'onlinePay' => 1,
+            'side' => 0,
+        ];
+        \bizHd\recharge\classes\RechargeClass::complete($recharge, $payWay, $params);
+
         util::success($post);
     }