<?php
/**
 * Copy Right IJH.CC
 * Each engineer has a duty to keep the code elegant
 * $Id$
 */
if(!defined('__CORE_DIR')){
    exit("Access Denied");
}

class Ctl_XiChe_Mcenter_Main extends Ctl_XiChe_Mcenter {
  
  // 管理中心
  public function index()
  { 
  	//var_dump(strtotime(date('Y-m-d H:i:s')));exit;
    $td = strtotime(date('Y-m-d', time()));
    $tmd = strtotime(date('Y-m-d', time()+86400)); 

    $todaywwc = K::M('xiche/order')->count(array('order_status'=>2));  // 未处理、总待处理
	$today = K::M('xiche/order')->count(array('order_status'=>3,'fuwu_time'=>$td."~".$tmd,'staff_id'=>$this->staff['staff_id'])); //今日任务
	$todaywc = K::M('xiche/order')->count(array('order_status'=>4,'fuwu_time'=>$td."~".$tmd,'staff_id'=>$this->staff['staff_id'])); // 今日完成
	$complete=  K::M('xiche/order')->count(array('order_status'=>4,'staff_id'=>$this->staff['staff_id'])); //总计完成
   
    $news = K::M('xiche/order')->count(array('order_status'=>2,'fuwu_time'=>'>:'.$td)); //总新单

	$this->pagedata['news'] = $news;
	$this->pagedata['today'] = $today;
	$this->pagedata['todaywc'] = $todaywc;
	$this->pagedata['complete'] = $complete;
	$this->pagedata['todaywwc'] = $todaywwc;

  	$this->tmpl = 'xiche/mcenter/main/main.html';
  }

}