diff --git a/app/common/dao/store/StoreActivityUserDao.php b/app/common/dao/store/StoreActivityUserDao.php
index 56ee6dff..8e0568f3 100755
--- a/app/common/dao/store/StoreActivityUserDao.php
+++ b/app/common/dao/store/StoreActivityUserDao.php
@@ -281,34 +281,36 @@ class StoreActivityUserDao extends BaseDao
     /**
      * 红包余额统计
      * @param int $userId
-     * @return array
+     * @return array|array[]
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function total(int $userId)
     {
         $totalAmount = StoreConsumptionUser::where('uid', $userId)
             ->whereIn('type', [StoreConsumptionUser::TYPE_ONE, StoreConsumptionUser::TYPE_TWO])
-            ->where('status', StoreConsumptionUser::STATUS_UNUSED)
-            ->field('SUM(balance) as total_amount,type')
-            ->group('type')
+            ->whereIn('status', [StoreConsumptionUser::STATUS_UNUSED, StoreConsumptionUser::STATUS_REPEAL])
+            ->field('balance,type')
             ->select()->toArray();
-        $totalAmount = reset_index($totalAmount, 'type');
         $result = [
-            [
+            '1' => [
                 'type' => 1,
-                'total_amount' => 0.00
+                'total_amount' => 0.00,
+                'type_cn' => StoreConsumptionUser::TYPE_MAP[1],
             ],
-            [
+            '2' => [
                 'type' => 2,
-                'total_amount' => 0.00
+                'total_amount' => 0.00,
+                'type_cn' => StoreConsumptionUser::TYPE_MAP[2],
             ]
         ];
-        foreach ($result as &$item) {
-            if (isset($totalAmount[$item['type']])) {
-                $item['total_amount'] = $totalAmount[$item['type']]['total_amount'];
+        foreach ($totalAmount as $item) {
+            if (isset($result[$item['type']])) {
+                $result[$item['type']]['total_amount']= bcadd($result[$item['type']]['total_amount'], $item['balance'], 2);
             }
-            $item['type_cn'] = StoreConsumptionUser::TYPE_MAP[$item['type']];
         }
-        return $result;
+        return array_values($result);
     }
 
 }
diff --git a/app/common/dao/store/consumption/StoreConsumptionUserDao.php b/app/common/dao/store/consumption/StoreConsumptionUserDao.php
index 64e0754d..9b30e2eb 100755
--- a/app/common/dao/store/consumption/StoreConsumptionUserDao.php
+++ b/app/common/dao/store/consumption/StoreConsumptionUserDao.php
@@ -52,6 +52,7 @@ class StoreConsumptionUserDao extends BaseDao
     public $startTime;
     public $endTime;
     public $billExtra;
+    public $onlyBill = false; // 是否只写入用户账单
 
     protected function getModel(): string
     {
@@ -241,10 +242,12 @@ class StoreConsumptionUserDao extends BaseDao
         $model = StoreConsumptionUser::where('uid', $userId)->where('type', StoreConsumptionUser::TYPE_TWO)->find();
         $couponPrice = bcmul($amount, $rate, 2);
         if (!empty($model) && $model['type'] == $type) {
-            $model->coupon_price = bcadd($model->coupon_price, $couponPrice, 2);
-            $model->balance = bcadd($model->balance, $couponPrice, 2);
-            if ($model->status != StoreConsumptionUser::STATUS_UNUSED) {
-                $model->status = StoreConsumptionUser::STATUS_UNUSED;
+            if (!$this->onlyBill) {
+                $model->coupon_price = bcadd($model->coupon_price, $couponPrice, 2);
+                $model->balance = bcadd($model->balance, $couponPrice, 2);
+                if ($model->status != StoreConsumptionUser::STATUS_UNUSED) {
+                    $model->status = StoreConsumptionUser::STATUS_UNUSED;
+                }
             }
         } else {
             $model = new StoreConsumptionUser();
@@ -260,6 +263,9 @@ class StoreConsumptionUserDao extends BaseDao
             $model->end_time = $this->endTime ?: '2026-01-15 23:59:59';
             $model->type = $type;
             $model->status = $status;
+            if ($this->onlyBill === true) {
+                $model->status = StoreConsumptionUser::STATUS_REPEAL;
+            }
         }
         if (!$model->save()) {
             throw new \Exception('发放失败');
diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php
index fe71060d..5236b70d 100755
--- a/app/controller/api/store/merchant/Merchant.php
+++ b/app/controller/api/store/merchant/Merchant.php
@@ -301,6 +301,7 @@ class Merchant extends BaseController
         if (empty($merchantInfo)) {
             return app('json')->fail('参数错误');
         }
+        $merchantInfo['paid_margin'] = $merchantInfo['paid_margin'] > $merchantInfo['margin'] ? $merchantInfo['margin'] : $merchantInfo['paid_margin'];
         $merchantInfo['unpaid_margin'] = bcsub($merchantInfo['margin'], $merchantInfo['paid_margin'], 2);
         if ($merchantInfo['margin'] <= 0) {
             $merchantInfo['unpaid_margin'] = 0;
diff --git a/crmeb/listens/SendSubsidyCouponListen.php b/crmeb/listens/SendSubsidyCouponListen.php
index fedc4bda..6b1d3462 100644
--- a/crmeb/listens/SendSubsidyCouponListen.php
+++ b/crmeb/listens/SendSubsidyCouponListen.php
@@ -43,8 +43,10 @@ class SendSubsidyCouponListen extends TimerService implements ListenerInterface
                                 'coupon_id' => $consumption['coupon_id'],
                                 'sale_amount' => $item['amount'],
                                 'purchase_amount' => $purchaseAmount,
+                                'status' => -1,
                             ];
-                            $consumptionRepo->send($consumption, 1, $merchant->uid, 0, $amount, StoreConsumptionUser::STATUS_UNUSED, StoreConsumptionUser::TYPE_TWO);
+                            $consumptionRepo->onlyBill = true;
+                            $consumptionRepo->send($consumption, 1, $merchant->uid, 0, $amount, StoreConsumptionUser::STATUS_REPEAL, StoreConsumptionUser::TYPE_TWO);
                             $count++;
                         }
                     }