From a26a1191cc67b973aa4aeb7454db40ccedbe58bc Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 14 Feb 2020 11:40:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8A=E6=B8=B8=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/StatementController.class.php | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/StatementController.class.php b/Application/Admin/Controller/StatementController.class.php index d4a5a1f95..d369fd60b 100644 --- a/Application/Admin/Controller/StatementController.class.php +++ b/Application/Admin/Controller/StatementController.class.php @@ -110,6 +110,8 @@ class StatementController extends ThinkController $Statement = M("statement","tab_"); $repart =false; $errorstr = ''; + $errorstr1 = ''; + $errorstr2 = ''; //开始时间被重叠部分 $checkmap = array( "statement_begin_time"=>array("ELT",strtotime($_REQUEST['time_start'])), @@ -126,7 +128,7 @@ class StatementController extends ThinkController }else{ $end = $_REQUEST['time_end']; } - $errorstr .= ($begin."到".$end."期间的数据已经结算过
"); + $errorstr = ($begin."到".$end."期间的数据已经结算过
"); } //结束被重复的部分 $checkmap = array( @@ -134,18 +136,41 @@ class StatementController extends ThinkController "statement_end_time"=>array("EGT",strtotime($_REQUEST['time_end'])), "company_id"=>$CompanyId ); - if($repart){ - $checkmap["id"]=array("NEQ",$bres["id"]); - } + $bres = $Statement->field("statement_begin_time,statement_end_time")->where($checkmap)->find(); if($bres){ $repart=true; $begin = date("Y-m-d",$bres["statement_begin_time"]); //统计相交时间 $end = $_REQUEST['time_end']; - $errorstr .= ($begin."到".$end."期间的数据已经结算过
"); + $errorstr1 = ($begin."到".$end."期间的数据已经结算过
"); + } + //中间被包住 + $checkmap = array( + "statement_begin_time"=>array("EGT",strtotime($_REQUEST['time_start'])), + "statement_end_time"=>array("ELT",strtotime($_REQUEST['time_end'])), + "company_id"=>$CompanyId + ); + $bres = $Statement->field("statement_begin_time,statement_end_time")->where($checkmap)->find(); + if($bres){ + $repart=true; + $begin = date("Y-m-d",$bres["statement_begin_time"]); + //统计相交时间 + $end = date("Y-m-d",$bres["statement_end_time"]); + $errorstr2 = ($begin."到".$end."期间的数据已经结算过
"); } + if($repart){ + if($errorstr1 == $errorstr){ + $errorstr1 =''; + } + if($errorstr1 == $errorstr2){ + $errorstr1 =''; + } + if($errorstr == $errorstr2){ + $errorstr2 =''; + } + $errorstr .=($errorstr1.$errorstr2); $this->ajaxReturn(array("error"=>$errorstr,"code"=>2001)); }