Browse Source

积分明细

lizhen_gitee 7 months ago
parent
commit
4e8bd1228e
1 changed files with 11 additions and 1 deletions
  1. 11 1
      application/api/controller/Userwallet.php

+ 11 - 1
application/api/controller/Userwallet.php

@@ -20,8 +20,18 @@ class Userwallet extends Api
 
     //积分日志
     public function score_log(){
+        $type = input('type',1);
+
+        $where = [
+            'user_id' => $this->auth->id
+        ];
+        if($type == 1){
+            $where['change_value'] = ['egt',0];
+        }else{
+            $where['change_value'] = ['lt',0];
+        }
         $list = Db::name('user_score_log')->field('id,before,change_value,remain,remark,createtime')
-            ->where('user_id',$this->auth->id)->autopage()->select();
+            ->where($where)->autopage()->select();
 
         if(!empty($list)){
             foreach($list as $key => &$val){