From 52b7c373601edbc5010471082eb88dadf70e382d Mon Sep 17 00:00:00 2001
From: liyaozhi <lzhflash@163.com>
Date: Wed, 29 Oct 2025 19:25:23 +0800
Subject: [PATCH] 1、修复活动报名支付问题; 2、修复签到核销码问题。

---
 admin/app/common/model/supplier/Supplier.php |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/admin/app/common/model/supplier/Supplier.php b/admin/app/common/model/supplier/Supplier.php
index 6383036..3cfe776 100644
--- a/admin/app/common/model/supplier/Supplier.php
+++ b/admin/app/common/model/supplier/Supplier.php
@@ -6,6 +6,7 @@
 use app\shop\model\auth\User as AuthUserModel;
 use app\shop\model\auth\UserRole as UserRoleModel;
 use app\common\model\shop\Role as RoleModel;
+use app\common\model\supplier\PointsLog as PointsLogModel;
 
 /**
  * 商家供应商模型
@@ -81,6 +82,27 @@
         }
         return true;
     }
+
+    /**
+     * 累积商户的可用积分
+     */
+    public function setIncPoints($points, $describe, $decPoints = 0)
+    {
+        // 新增积分变动明细
+        PointsLogModel::add([
+            'shop_supplier_id' => $this['shop_supplier_id'],
+            'value' => $points,
+            'describe' => $describe,
+            'app_id' => $this['app_id'],
+        ]);
+
+        // 更新用户可用积分
+        $data['points'] = ($this['points'] + $points + $decPoints <= 0) ? 0 : $this['points'] + $points + $decPoints;
+        $this->where('branch_id', '=', $this['branch_id'])->update($data);
+        
+        return true;
+    }
+
     //判断营业时间
     public function supplierStatus($shop_supplier_id)
     {

--
Gitblit v1.9.2