auth->money; $this->success('success',$wallet); } //我的余额日志 public function my_money_log() { $tab = $this->request->param('type', 'all'); $where = [ 'user_id' => $this->auth->id, ]; if($tab == 1){ $where['change_value'] = ['>', 0]; } if($tab == 2){ $where['change_value'] = ['<', 0]; } $logs = Db::name('user_money_log') ->field('id,log_type,before,change_value,remain,remark,createtime') ->where($where) ->order('id desc') ->autopage()->select(); $this->success(1, $logs); } //善豆明细 public function my_bean_log(){ $type = input('type',0); $map = [ 'user_id' => $this->auth->id, ]; if($type){ $map['log_type'] = $type; } $list = Db::name('user_bean_log') ->field('id,log_type,before,change_value,remain,remark,createtime') ->where($map) ->order('id desc') ->autopage()->select(); // $list = $this->list_appen_logtext($list); $this->success(1,$list); } //追加log_text private function list_appen_logtext($list){ if(!empty($list)){ $conf = config('wallet.logtype'); foreach($list as $key => $val){ $list[$key]['log_text'] = isset($conf[$val['log_type']]) ? $conf[$val['log_type']] : ''; } } return $list; } }