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

$T=$G['this']->data()->open('credit.log')->record("userid='$G[userid]' order by id desc $G[pagelimit]");
if(count($T)<12){
  $A['tpl']='refresh';
}
foreach($T as $rs){
  $P=$G['this']->data()->open('product')->one("id='$rs[key2]'");
  $u=onez('user')->info($rs['userid']);
  $rt='';
  if($rs['key2']>0){
    $rt='<span style="color:green;font-weight:bold">+'.$rs['key2'].'</span>';
  }else{
    $rt='<span style="color:red;font-weight:bold">'.$rs['key2'].'</span>';
  }
  $record[]=array(
    'type'=>'pictext2',
    'subject'=>date('Y-m-d H:i:s',$rs['addtime']).'<div class="pull-right">'.$rt.'</div>',
    'summary'=>$rs['key1'],
  );
}