diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index d0a45faf6..411003d29 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -1073,33 +1073,27 @@ class CompanyStatementPoolController extends ThinkController foreach ($gv as $lk => $lv){ if ($lk > 0) { + unset($lv['time']); + + } else { + + $lv['row'] = count($gv); + $lv['week_amount'] = $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine']; for (;;) { - if (!$handle_data[$lk-$substract]['time']) { -// $nline++; - $substract++; + if (!$gv[$lk+$substract]) { + break; } else { - $handle_data[$lk-$substract]['row'] += 1; - $handle_data[$lk-$substract]['week_amount'] += $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine']; + $lv['week_amount'] += $gv[$lk+$substract]['sum_money'] - $gv[$lk+$substract]['withhold'] + $gv[$lk+$substract]['reward'] - $gv[$lk+$substract]['fine']; -// if ($is_export) { -// $handle_data[$lk-$substract]['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)"; -// } - unset($lv['time']); - break; + $substract++; + unset($gv[$lk+$substract]['time']); } } + $substract = 1; - } else { - - $lv['row'] = 1; - $lv['week_amount'] = $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine']; -// $nline++; -// if ($is_export) { -// $lv['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)"; -// } } array_push($handle_data,$lv); @@ -1111,11 +1105,13 @@ class CompanyStatementPoolController extends ThinkController foreach($handle_data as $hk => $hv) { $substract = 1; if ($is_export) { -// dump($hv); + if (!$hv['time']) { + continue; + } + for (;;) { if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]&&$hv['time']) { -// dump($handle_data[$hk+$substract]); $cline++; $substract++; @@ -1125,40 +1121,15 @@ class CompanyStatementPoolController extends ThinkController } -// if (count($handle_data)>1) { -// $cline += count($handle_data)-1; -// } - - if ($hv['time']&&$hk!=0) { - $nline =+ $cline+1; - $cline = $nline; - } - $handle_data[$hk]['week_amount'] = "=ROUND(SUM(J{$nline}:J{$cline})-SUM(K{$nline}:K{$cline})+SUM(L{$nline}:L{$cline})-SUM(M{$nline}:M{$cline}),2)"; -// if ($hk > 0) { -// $handle_data[0]['week_amount'] = str_replace($nline,$cline,$handle_data[0]['week_amount']); -// } - -// if (count($handle_data)>1) { -// -// $nline += count($handle_data); -// -// } else { -// $nline++; -// } -// -// if(count($handle_data)>1) { -// -// $cline = $nline ; -// } else { -// $cline = $nline; -// } + $cline++; + $nline = $cline; } } -// die(); + return $handle_data; } @@ -1185,32 +1156,26 @@ class CompanyStatementPoolController extends ThinkController if ($lk > 0) { + unset($lv['time']); + + } else { + + $lv['row'] = count($gv); + $lv['week_amount'] = $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine']; + for (;;) { - if (!$handle_data[$lk-$substract]['time']) { -// $nline++; - $substract++; + if (!$gv[$lk+$substract]) { + break; } else { - $handle_data[$lk-$substract]['row'] += 1; - $handle_data[$lk-$substract]['week_amount'] += $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine']; + $lv['week_amount'] += $gv[$lk+$substract]['sum_money'] - $gv[$lk+$substract]['withhold'] + $gv[$lk+$substract]['reward'] - $gv[$lk+$substract]['fine']; -// if ($is_export) { -// $handle_data[$lk-$substract]['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)"; -// } - unset($lv['time']); - break; + $substract++; + unset($gv[$lk+$substract]['time']); } } - - } else { - - $lv['row'] = 1; - $lv['week_amount'] = $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine']; -// $nline++; -// if ($is_export) { -// $lv['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)"; -// } + $substract = 1; } array_push($handle_data,$lv); @@ -1222,11 +1187,13 @@ class CompanyStatementPoolController extends ThinkController foreach($handle_data as $hk => $hv) { $substract = 1; if ($is_export) { -// dump($hv); + if (!$hv['time']) { + continue; + } + for (;;) { if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]&&$hv['time']) { -// dump($handle_data[$hk+$substract]); $cline++; $substract++; @@ -1236,40 +1203,14 @@ class CompanyStatementPoolController extends ThinkController } -// if (count($handle_data)>1) { -// $cline += count($handle_data)-1; -// } - - if ($hv['time']&&$hk!=0) { - $nline =+ $cline+1; - $cline = $nline; - } - $handle_data[$hk]['week_amount'] = "=ROUND(SUM(L{$nline}:L{$cline})-SUM(M{$nline}:M{$cline})+SUM(N{$nline}:N{$cline})-SUM(O{$nline}:O{$cline}),2)"; -// if ($hk > 0) { -// $handle_data[0]['week_amount'] = str_replace($nline,$cline,$handle_data[0]['week_amount']); -// } - -// if (count($handle_data)>1) { -// -// $nline += count($handle_data); -// -// } else { -// $nline++; -// } -// -// if(count($handle_data)>1) { -// -// $cline = $nline ; -// } else { -// $cline = $nline; -// } + $cline++; + $nline = $cline; } } -// die(); return $handle_data; } diff --git a/Application/Admin/View/CompanyStatementPool/viewCpPool.html b/Application/Admin/View/CompanyStatementPool/viewCpPool.html index a588fc36c..c4268d24f 100644 --- a/Application/Admin/View/CompanyStatementPool/viewCpPool.html +++ b/Application/Admin/View/CompanyStatementPool/viewCpPool.html @@ -161,8 +161,8 @@