songxingwei 3 年之前
父節點
當前提交
87e5eb6eb5
共有 2 個文件被更改,包括 9 次插入2 次删除
  1. 3 1
      application/api/controller/Index.php
  2. 6 1
      application/common/model/User.php

+ 3 - 1
application/api/controller/Index.php

@@ -272,12 +272,14 @@ class Index extends Api
      *
      * @param name:page type:int require:0 default:1 desc:
      * @param name:limit type:int require:0 default:10 desc:
+     * @param name:type type:int require:0 default: desc:1:权益积分释放记录3:库存积分释放记录
      */
     public function equity_records(){
         $user_id = $this->check_login();
         $Nowpage = input('page',1);
         $limits = input("limit",10);
-        $result = User::EquityRecords($user_id,$Nowpage,$limits);
+        $type = input("type");
+        $result = User::EquityRecords($user_id,$Nowpage,$limits,$type);
         $this->success($result['msg'],$result['data']);
     }
 

+ 6 - 1
application/common/model/User.php

@@ -483,8 +483,13 @@ class User Extends Model
     /**
      * 释放记录
      */
-    public static function EquityRecords($user_id,$Nowpage,$limits){
+    public static function EquityRecords($user_id,$Nowpage,$limits,$type){
         $where = ['user_id'=>$user_id,'status'=>3];
+        if ($type){
+            $where['type'] = $type;
+        }else{
+            $where['type'] = ['in','1,3'];
+        }
         $count = MoneyLog::where($where)
             ->whereIn('type','1,3')
             ->count();