<?php

/*************************************************************************\
|                                                                         |
| 房佳（专业的新房分销ERP管理系统）                                       |
|                                                                         |
| Copyright (c) 2008-2019 http://fj.ytsofts.cn/ All rights reserved. |
|                                                                         |
| 本系统由淮南市银泰软件科技有限公司提供技术支持                          |
|                                                                         |
| QQ号：984784483                                                         |
|                                                                         |
\*************************************************************************/

namespace Admin\Controller;
use Think\Controller;
class dlrizhiController extends CommonController {
    // 登录日志首页
    public function index(){
        $tj="gongsiid=".session('gongsiid');
        $tj .= " and ipdizhi <> '127.0.0.1'";
        if (I('shijian1') and I('shijian2')){
            $tj .= " and shijian >= ".strtotime(I('shijian1'))." and shijian < ".(strtotime(I('shijian2'))+86399);
        }elseif (I('shijian1')) {
            $tj .= " and shijian >= ".strtotime(I('shijian1'));
        }elseif (I('shijian2')) {
            $tj .= " and shijian < ".(strtotime(I('shijian2'))+86399);
        }
        $this->bumen =M('bumen')->select();
        $count=M('dlrizhi')->query("select count(*) from __DLRIZHI__ where {$tj}");
        $Page = new \Think\Page($count['0']['count(*)'],30);
        $show = $Page->show();
        $list = M('dlrizhi')->where($tj)->limit($Page->firstRow.','.$Page->listRows)->order('shijian desc')->select();
        $this->assign('firstRow',$Page->firstRow);
        $this->assign('dlrizhi',$list);// 赋值数据集
        $this->assign('count',$count);// 赋值分页输出
        $this->assign('page',$show);
        $this->display();
    }
}