shish 4 лет назад
Родитель
Сommit
fe39b4f75e
3 измененных файлов с 17 добавлено и 13 удалено
  1. 1 1
      app-hd/controllers/RefundController.php
  2. 6 11
      app-mall/controllers/NoticeController.php
  3. 10 1
      sql.txt

+ 1 - 1
app-hd/controllers/RefundController.php

@@ -101,7 +101,7 @@ class RefundController extends BaseController
             $shopAdmin = $this->shopAdmin;
             $adminName = $shopAdmin['name'] ?? '';
             $post['shopAdminName'] = $adminName;
-            HdRefundService::addRefund($id, $post);
+            HdRefundService::addRefund($post,$order);
             $transaction->commit();
 
         } catch (\Exception $exception) {

+ 6 - 11
app-mall/controllers/NoticeController.php

@@ -2,6 +2,7 @@
 
 namespace mall\controllers;
 
+use bizHd\refund\classes\HdRefundClass;
 use bizHd\wx\classes\WxOpenClass;
 use common\components\noticeUtil;
 use common\components\payUtil;
@@ -29,7 +30,7 @@ class NoticeController extends PublicController
         }
 
         //解密req_info
-        $wx = WxOpenClass::getWxInfo();
+        $wx = WxOpenClass::getMallWxInfo();
         $req_info = $postObj->req_info ?? '';
         $key = $wx['wxPayKey'] ?? '';
         $xml = openssl_decrypt(base64_decode($req_info), 'AES-256-ECB', MD5($key), OPENSSL_RAW_DATA, '');
@@ -55,16 +56,10 @@ class NoticeController extends PublicController
         $transaction = $connection->beginTransaction();
         try {
             if ($refund_status == 'SUCCESS') {
-                $cgRefund = HdRefundClass::getByCondition(['orderSn' => $out_refund_no], true);
-                if (!empty($cgRefund)) {
-                    $cgRefund->status = HdRefundClass::STATUS_COMPLETE;
-                    $cgRefund->save();
-                    $saleRefundId = $cgRefund->saleRefundId ?? 0;
-                    $saleRefund = RefundOrderClass::getById($saleRefundId, true);
-                    if (!empty($saleRefund)) {
-                        $saleRefund->status = RefundOrderClass::STATUS_COMPLETE;
-                        $saleRefund->save();
-                    }
+                $hdRefund = HdRefundClass::getByCondition(['refundSn' => $out_refund_no], true);
+                if (!empty($hdRefund)) {
+                    $hdRefund->status = HdRefundClass::STATUS_COMPLETE;
+                    $hdRefund->save();
                 }
                 $text = "【退款成功】退款单号:{$orderSn} {$out_refund_no} 订单金额:{$new_total_fee} 退款金额:{$new_settlement_refund_fee} ";
             } elseif ($refund_status == 'REFUNDCLOSE') {

+ 10 - 1
sql.txt

@@ -942,6 +942,15 @@ ALTER TABLE xhHdRefundItem ADD shopId INT NOT NULL DEFAULT 0 COMMENT '' AFTER `m
 ALTER TABLE xhHdRefundGoods ADD sjId INT NOT NULL DEFAULT 0 COMMENT '' AFTER `mainId`;
 ALTER TABLE xhHdRefundGoods ADD shopId INT NOT NULL DEFAULT 0 COMMENT '' AFTER `mainId`;
 
- ALTER TABLE xhHdRefund ADD `thirdRefundNo` CHAR(50) NOT NULL DEFAULT '' COMMENT '第三方支付id' AFTER `orderId`;
+ALTER TABLE xhHdRefund ADD `thirdRefundNo` CHAR(50) NOT NULL DEFAULT '' COMMENT '第三方支付id' AFTER `orderId`;
+
+ALTER TABLE xhMain ADD `totalView` INT(11) NOT NULL DEFAULT '0' COMMENT '累计访问次数' AFTER `totalStockOut`;
+ALTER TABLE xhMain ADD `totalVisit` INT(11) NOT NULL DEFAULT '0' COMMENT '累计访客数,每个IP一个访客' AFTER `totalStockOut`;
+ALTER TABLE xhMain ADD `totalUser` INT(11) NOT NULL DEFAULT '0' COMMENT '总用户;总客户数' AFTER `totalStockOut`;
+ALTER TABLE xhMain ADD `totalPurchaseOrder` INT(11) NOT NULL DEFAULT '0' COMMENT '总采购订单' AFTER `totalStockOut`;
+ALTER TABLE xhMain ADD `totalPdAdd` DECIMAL(15,2) NOT NULL DEFAULT '0.00' COMMENT '累计盘盈' AFTER `totalStockOut`;
+ALTER TABLE xhMain ADD `totalPdSub` DECIMAL(15,2) NOT NULL DEFAULT '0.00' COMMENT '累计盘亏' AFTER `totalStockOut`;
+ALTER TABLE xhMain ADD `totalWast` DECIMAL(15,2) NOT NULL DEFAULT '0.00' COMMENT '累计报损' AFTER `totalStockOut`;
+ALTER TABLE xhMain ADD `totalRefund` DECIMAL(15,2) NOT NULL DEFAULT '0.00' COMMENT '累计退款金额' AFTER `totalStockOut`;
 
 ---ssh 20220424