<?php

/***************************************************************\
|																|
| 开单大师（专业的房产ERP管理系统）								|
|																|
| © 2018 http://www.kaidandashi.com All rights reserved.		|
|																|
| 本系统由淮南市银泰软件科技有限公司提供技术支持				|
|																|
| QQ号：2159094518												|
|																|
\***************************************************************/

namespace Admin\Controller;
use Think\Controller;
class dlrizhiController extends CommonController {
    // 登录日志首页
    public function index(){
        $tj="gongsiid=".session('gongsiid');
        $tj .= " and ipdizhi <> '220.178.213.186'";
        $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);
        }
        $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();
    }
}