  <title>积分日志</title>

  <div class="layui-card layadmin-header">
    <div class="layui-breadcrumb" lay-filter="breadcrumb">
      <a lay-href="">主页</a>
      <a><cite>问答管理</cite></a>
      <a><cite>基本设置</cite></a>
      <a><cite>积分日志</cite></a>
    </div>
  </div>
  
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
  <!--选项卡-->
      <div class="layui-card-body">
          <div class="layui-tab layui-tab-brief" lay-filter="J_tabLi">
            <ul class="layui-tab-title">
              <li><a lay-href="wendansns/credit/effect">积分策略</a></li>
              <li class="layui-this">积分日志</li>
            </ul>
          </div>
      </div>

        <div class="layui-card-body">
        
    <form class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="J_ajaxForm">
      <div class="layui-form-item">
        
        <div class="layui-inline">
          <label class="layui-form-label">作者</label>
          <div class="layui-input-block">
            <input type="text" name="username" class="layui-input">
          </div>
        </div>

        <div class="layui-inline">
          <label class="layui-form-label">时间</label>
          <div class="layui-input-block">
            <div class="layui-input-inline" style="width: 120px;">
              <input type="text" name="min_time" id="J_timeDate_min" class="layui-input test-laydate-item">
            </div>
            <div class="layui-form-mid">-</div>
            <div class="layui-input-inline" style="width: 120px;">
              <input type="text" name="max_time" id="J_timeDate_max" class="layui-input test-laydate-item">
            </div>
          </div>
        </div>
        
        <div class="layui-inline">
          <input type="button" class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="J_form_search" value="搜索">
        </div>

        </div>
      </form>
    </div>
    
          <div class="layui-card-body">
            <table class="layui-hide" id="J_table_list" lay-filter="J_table_list"></table>
          </div>
        </div>
      </div>
    </div>
  </div>

<script type="text/html" id="J_credit_tpl">
  {{# if(d.credit<0){ }}
  <span style="color: #FF5722;">{{d.credit}}</span>
  {{# }else{ }}
  <span style="color: #5FB878;">{{d.credit}}</span>
  {{# } }}
</script>

<script>
;!function(){
    var $ = layui.$
  ,table = layui.table;

    table.render({
      elem: '#J_table_list'
      ,url: '{:url('wendasns/credit/log')}'
      ,cols: [[
        {type:'checkbox'}
        ,{field:'id',title:'ID',align:'center',width:100}
        ,{field:'username',title:'用户',width:120}
        ,{field:'behavior',title:'操作',width: 120}
        ,{field:'credit',title:'明细',align:'center',width:80,templet:'#J_credit_tpl'}
        ,{field:'create_time',title:'时间',width:160}
      ]]
    ,page: true
    ,limit: 20
    ,height: 'auto'
    ,text: {
      none: '没有数据哦'
    }
  })
    
  
}();
function showTime(t){
    var time = new Date(parseInt(t) * 1000)
    ,y = time.getFullYear()
    ,m = time.getMonth()+1
    ,d = time.getDate()
    ,h = time.getHours()
    ,i = time.getMinutes();
    return y+'-'+p(m)+'-'+p(d)+' '+p(h)+':'+p(i);
}
function p(s) {
        return s < 10 ? '0' + s: s;
    }
</script>