if(isset($_REQUEST['time1']) && $_REQUEST['time1'] != ''&&isset($_REQUEST['time2']) && $_REQUEST['time2'] != ''){ $map['shijian'] =array(array('egt',I('time1').' 00:00:00'),array('elt',I('time2').' 59:59:59')); $map1['addtime'] =array(array('egt',I('time1').' 00:00:00'),array('elt',I('time2').' 59:59:59')); $qujian=I('time1').'-'.I('time2'); }else{ $map['shijian'] =array(array('egt',date("Y-m-d",time()).' 00:00:00'),array('elt',date("Y-m-d",time()).' 59:59:59')); $map1['addtime'] =array(array('egt',date("Y-m-d",time()).' 00:00:00'),array('elt',date("Y-m-d",time()).' 59:59:59')); $qujian=date("Y-m-d",time()).' 00:00:00 -'.date("Y-m-d H:m:s",time()); } if(session('iszb')=='是'){ $where['shopid']=array("eq",I('shopid')); }else{ $where['shopid']=array("eq",session("shopid")); } $map1['_complex'] = $where;

### {$Think.session.shopid|get_shop_name=###}交班交接表

审核人: | 接收人: | 交接人: {$Rs.uname} | 打印:echo date("Y-m-d H:i:s",time());

{$qujian}:
现金收入 | $xianjin=M('zijin')->where($map1)->sum('xianjin'); echo $xianjin/1; | 银联收入 | $pos=M('zijin')->where($map1)->sum('pos'); echo $pos/1; | 余额支付 | $yue=M('zijin')->where($map1)->sum('yue'); echo $yue/1; | 优惠金额 | $jian=M('zijin')->where($map1)->sum('jian'); echo $jian/1; | 赠送金额 | $song=M('zijin')->where($map1)->sum('song'); echo $song/1;

ID | 产品编号 | 产品名称 | 计量单位 | {$qujian}统计
--- | --- | --- | --- | ---
入库/退货/归还 | 出库/销售/调拨 | 目前库存
{$v.id} | {$v.bianhao} | {$v.title|msubstr=###,0,20} | {$v.danwei|msubstr=###,0,20} | $where['bianhao']=array("eq",$v['bianhao']); $map['_complex'] = $where; echo M('rukus')->where($map)->sum('shuliang')/1; | $where['bianhao']=array("eq",$v['bianhao']); $map['_complex'] = $where; echo M('chukus')->where($map)->sum('shuliang')/1; | {$v.kucun}