浏览代码

用户积分流水记录

541469799@qq.com 1 年之前
父节点
当前提交
0b3b58454c
共有 2 个文件被更改,包括 8 次插入1 次删除
  1. 6 0
      app/api/controller/User.php
  2. 2 1
      app/api/model/user/AccumulatePointsLog.php

+ 6 - 0
app/api/controller/User.php

@@ -13,6 +13,7 @@ declare (strict_types = 1);
 namespace app\api\controller;
 
 use app\api\model\OrderRefund;
+use app\api\model\user\AccumulatePointsLog;
 use app\api\model\user\CommissionsDetail;
 use app\api\model\user\UserIdcards;
 use app\api\model\UserCoupon;
@@ -288,5 +289,10 @@ class User extends Controller
         //需要在售后成功后减掉在途的金米粒,并更新订单表里的gold_rice_amount_input字段数量
         return $this->renderSuccess('成功更新'.$num.'个订单');
     }
+
+    public function accumulatePointsRecords(){
+        $list = (new AccumulatePointsLog)->getList();
+        return $this->renderSuccess(compact('list'));
+    }
        
 }

+ 2 - 1
app/api/model/user/AccumulatePointsLog.php

@@ -28,12 +28,13 @@ class AccumulatePointsLog extends AccPointsLog
      * @throws \app\common\exception\BaseException
      * @throws \think\db\exception\DbException
      */
-    public function getList()
+    public function getList($scene = 10)
     {
         // 当前用户ID
         $userId = UserService::getCurrentLoginUserId();
         // 获取列表数据
         return $this->where('user_id', '=', $userId)
+            ->where('scene', '=', $scene)
             ->order(['create_time' => 'desc'])
             ->paginate(15);
     }