|
|
|
@ -54,13 +54,13 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
|
|
|
|
|
$time_start = strtotime($_REQUEST['time_start']);
|
|
|
|
|
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
|
|
|
|
|
$map["_string"] = "(statement_begin_time BETWEEN {$time_start} AND {$time_end}) OR (statement_end_time BETWEEN {$time_start} AND {$time_end})";
|
|
|
|
|
$map["_string"] = "( (statement_begin_time BETWEEN {$time_start} AND {$time_end}) OR (statement_end_time BETWEEN {$time_start} AND {$time_end}) )";
|
|
|
|
|
} elseif (isset($_REQUEST['time_start'])) {
|
|
|
|
|
$time_start = strtotime($_REQUEST['time_start']);
|
|
|
|
|
$map["_string"] = "(statement_begin_time >= {$time_start} ) OR (statement_end_time >= {$time_start})";
|
|
|
|
|
$map["_string"] = "( (statement_begin_time >= {$time_start} ) OR (statement_end_time >= {$time_start}) )";
|
|
|
|
|
} elseif (isset($_REQUEST['time_end'])) {
|
|
|
|
|
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
|
|
|
|
|
$map["_string"] = "(statement_begin_time <= {$time_end} ) OR (statement_end_time <= {$time_end})";
|
|
|
|
|
$map["_string"] = "( (statement_begin_time <= {$time_end} ) OR (statement_end_time <= {$time_end}) )";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['time_start2']) && isset($_REQUEST['time_end2'])) {
|
|
|
|
@ -144,7 +144,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
if(isset($_REQUEST['confirm_status'])){
|
|
|
|
|
$map['confirm_status'] = $_REQUEST['confirm_status'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// dd($map);
|
|
|
|
|
// $this->checkListOrCountAuthRestMap($map);//导出权限
|
|
|
|
|
//条件end
|
|
|
|
|
$data = M("company_statement","tab_")
|
|
|
|
@ -710,7 +710,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach ($dbres as $k=>$v) {
|
|
|
|
|
if($v['verify_status'] != 1) continue;
|
|
|
|
|
if($v['verify_status'] == 1 || $v['verify_status'] == -2){
|
|
|
|
|
if($v['company_belong'] == 9){
|
|
|
|
|
//上游
|
|
|
|
|
$this->setDf($datas['up'],$v);
|
|
|
|
@ -722,6 +722,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$this->setDf($datas['down'],$v);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$Pool = M("company_statement_pool","tab_");
|
|
|
|
|
$Statemen = M("company_statement","tab_");
|
|
|
|
@ -770,7 +771,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
M("company_lack_statement_info","tab_")->where("id in ({$v['del_lack_ids']})")->save(["is_pool"=>1]);
|
|
|
|
|
}
|
|
|
|
|
//修改结算单规则
|
|
|
|
|
$this->updatePoolVerifyStatus($v['statement_ids'],1,2,"pool",$v['statement_num']);
|
|
|
|
|
$this->updatePoolVerifyStatus($v['statement_ids'],2,"pool",$v['statement_num']);
|
|
|
|
|
}
|
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
|
'status' => 1,
|
|
|
|
@ -778,10 +779,10 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
//结算单规则
|
|
|
|
|
protected function updatePoolVerifyStatus($ids,$old_status,$change_status,$op_pre,$num){
|
|
|
|
|
protected function updatePoolVerifyStatus($ids,$change_status,$op_pre,$num){
|
|
|
|
|
$dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id in ({$ids})")->select();
|
|
|
|
|
foreach($dbres as $k=>&$v){
|
|
|
|
|
if($v['verify_status'] != $old_status) continue;
|
|
|
|
|
// if($v['verify_status'] != $old_status) continue;
|
|
|
|
|
$v['verify_log'] = json_decode($v['verify_log'],true);
|
|
|
|
|
$v['verify_log'][$op_pre.'_user']=$this->admininfo["username"];
|
|
|
|
|
$v['verify_log'][$op_pre.'_time']=date("Y.m.d H:i:s");
|
|
|
|
|