##### 打印机打印数量列表

打印机ID | 所属门店 | 打印机名称 | 打印机自编号 | 上月显示数量 | 本月显示数量 | 本月共打印 | 操作
--- | --- | --- | --- | --- | --- | --- | ---
$department=M("department"); $dId=$val["prDid"]; $rs_d=$department->where("dId=$dId")->find(); $ym=date("Y-m"); $printnumber=M("printnumber"); $map["pinDate"] =array("like",array($ym."%"),"AND"); $map["pinPRid"]=$val["prId"]; $rs_pn=$printnumber->where($map)->find(); $nowM=$rs_pn["pinDate"]; $valNowM=explode("-",$nowM); $nowM=$valNowM[1]; if($nowMonth!="01" && $nowMonth!=0){ $oldM=$nowMonth-1; if($oldM < 10){ $oldM="0".$oldM; } $ym2=date("Y"); $ym3=$ym2."-".$oldM; $map2["pinDate"] =array("like",array($ym3."%"),"AND"); $map2["pinPRid"]=$val["prId"]; $rs_count=$printnumber->where($map2)->count(); if($rs_count>0){ $rs_pn2=$printnumber->where($map2)->find(); }else{ $rs_pn2=$printnumber->where($map2)->find(); $rs_pnD2=$val["prDefaultN"]; } }elseif($nowMonth=="01"){ $oldM=12; $ym_1=date("Y"); echo $ym2=$ym_1-1; $ym3=$ym2."-".$oldM; $map2["pinDate"] =array("like",array($ym3."%"),"AND"); $map2["pinPRid"]=$val["prId"]; $rs_count=$printnumber->where($map2)->count(); if($rs_count>0){ $rs_pn2=$printnumber->where($map2)->find(); }else{ $rs_pn2=$printnumber->where($map2)->find(); $rs_pnD2=$val["prDefaultN"]; } } $a=0; if($nowMonth==$nowM){ $a=1; }else{ $a=2; } <{$val.prId}> | <{$rs_d.dName}> | <{$val.prName}> | <{$val.prNumber}> | <{$rs_pn2.pinNowNumber}> <{$val.prUnit}> | 上月数据还未统计 | <{$rs_pn.pinNowNumber}> <{$val.prUnit}> | 本月数据还未录入 if($rs_pn2["pinNowNumber"]!=null){ $Mzong=$rs_pn["pinNowNumber"]-$rs_pn2["pinNowNumber"]; if($Mzong<=0){ $Mzong=0; } }else{ $Mzong=$rs_pn["pinNowNumber"]-$rs_pnD2; if($Mzong<=0){ $Mzong=0; } } | <{$Mzong}> <{$val.prUnit}> | 录入本月 | 选择录入 修改本月 | 选择录入 修改本月 | 选择录入