至
  查询

## {$Rs.id|get_shop_name=###}

{$Rs.dianhua}
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()); } $where['shopid']=array("eq",$Rs['id']); $map1['_complex'] = $where;

现金收入：$yingyee=M('zijin')->where($map1)->sum('xianjin');echo $yingyee/1;

银联收入：$fukuan=M('zijin')->where($map1)->sum('pos');echo $fukuan/1;

提成:$ticheng=M('ticheng')->where($map1)->sum('jine');echo $ticheng/1;

明细记录

- 现金$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;
- 赠送$song=M('zijin')->where($map1)->sum('song');echo $song/1;
- 优惠$jian=M('zijin')->where($map1)->sum('jian');echo $jian/1;
- 费用支出 echo $fukuan/1;
- 顾问提成 echo $ticheng/1;