Kirin 3 years ago
parent
commit
f1a72de205
2 changed files with 6 additions and 4 deletions
  1. 3 3
      app/api/controller/user/UserBillController.php
  2. 3 1
      app/models/user/UserBill.php

+ 3 - 3
app/api/controller/user/UserBillController.php

@@ -352,10 +352,10 @@ class UserBillController
      */
     public function integral_list(Request $request)
     {
-        list($page, $limit) = UtilService::getMore([
-            ['page', 0], ['limit', 0]
+        list($page, $limit, $status) = UtilService::getMore([
+            ['page', 0], ['limit', 0], ['pm', 0]
         ], $request, true);
-        return app('json')->successful(UserBill::userBillList($request->uid(), $page, $limit));
+        return app('json')->successful(UserBill::userBillList($request->uid(), $page, $limit, 'integral', ['pm' => $status]));
 
     }
 }

+ 3 - 1
app/models/user/UserBill.php

@@ -59,13 +59,14 @@ class UserBill extends BaseModel
      * @throws \think\db\exception\ModelNotFoundException
      * @throws \think\exception\DbException
      */
-    public static function userBillList($uid, $page, $limit, $category = 'integral')
+    public static function userBillList($uid, $page, $limit, $category = 'integral', $where = [])
     {
         if ($page) {
             $list = self::where('uid', $uid)
                 ->where('category', $category)
                 ->field('mark,pm,number,add_time')
                 ->where('status', 1)
+                ->where($where)
                 ->order('add_time DESC')
                 ->page((int)$page, (int)$limit)
                 ->select();
@@ -74,6 +75,7 @@ class UserBill extends BaseModel
                 ->where('category', $category)
                 ->field('mark,pm,number,add_time')
                 ->where('status', 1)
+                ->where($where)
                 ->order('add_time DESC')
                 ->select();
         }