<?php
!defined('IN_ONEZ') && exit('Access Denied');
$groupid=(int)onez()->gp('groupid');
$A['title']='提现记录';
$A['tpl']='refresh_more';

$T=$G['this']->data()->open('cash')->record("userid='$G[userid]' order by id desc $G[pagelimit]");
if(count($T)<12){
  $A['tpl']='refresh';
}
if($G['page']<=1){
  $record[]=array(
    'type'=>'space',
    'height'=>'5',
  );
}
foreach($T as $rs){
  $rt='';
  if($rs['token']=='ok'){
    $rt='<span style="color:green">提现成功</span>';
  }elseif($rs['token']=='fail'){
    $rt='<span style="color:red">提现失败</span>';
  }else{
    $rt='<span style="color:orange">等待处理</span>';
  }
  $record[]=array(
    'type'=>'pictext',
    'name'=>date('Y-m-d H:i:s',$rs['addtime']),
    'myhtml'=>'<div class="right-info-link">'.$rt.'</div>',
  );
  $record[]=array(
    'type'=>'pictext',
    'name'=>'提现金额',
    'myhtml'=>'<div class="right-info-link">'.onez('chat.group.plugin.credit')->format($rs['money']).'</div>',
  );
  if($rs['token']=='fail'){
    $record[]=array(
      'type'=>'pictext',
      'style'=>array('color'=>'red'),
      'name'=>$rs['because'],
    );
  }
  $record[]=array(
    'type'=>'space',
    'height'=>'5',
  );
}