|
|
|
@ -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."期间的数据已经结算过<br/>");
|
|
|
|
|
$errorstr = ($begin."到".$end."期间的数据已经结算过<br/>");
|
|
|
|
|
}
|
|
|
|
|
//结束被重复的部分
|
|
|
|
|
$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."期间的数据已经结算过<br/>");
|
|
|
|
|
$errorstr1 = ($begin."到".$end."期间的数据已经结算过<br/>");
|
|
|
|
|
}
|
|
|
|
|
//中间被包住
|
|
|
|
|
$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."期间的数据已经结算过<br/>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($repart){
|
|
|
|
|
if($errorstr1 == $errorstr){
|
|
|
|
|
$errorstr1 ='';
|
|
|
|
|
}
|
|
|
|
|
if($errorstr1 == $errorstr2){
|
|
|
|
|
$errorstr1 ='';
|
|
|
|
|
}
|
|
|
|
|
if($errorstr == $errorstr2){
|
|
|
|
|
$errorstr2 ='';
|
|
|
|
|
}
|
|
|
|
|
$errorstr .=($errorstr1.$errorstr2);
|
|
|
|
|
$this->ajaxReturn(array("error"=>$errorstr,"code"=>2001));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|