Merge pull request '财务打款系统bug修复' (#264) from feature/add_item into release

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/264
master
郑永星 4 years ago
commit 2e21ea7c38

@ -1576,6 +1576,7 @@ class TimingController extends AdminController {
}
list($becomeTimeList,$becomeTimeCount) = $this->getAffairList(date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-1).'-01')));
// dump([$becomeTimeList,$becomeTimeCount]);die();
$time1 = date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-1).'-01'));
$time2 = date('Y-m',strtotime(date('Y',$time).'-'.(date('m',$time)-2).'-01'));
@ -1735,11 +1736,25 @@ class TimingController extends AdminController {
function diffDate($date1,$date2)
{
$datetime1 = new \DateTime($date1);
$datetime2 = new \DateTime($date2);
$interval = $datetime1->diff($datetime2);
$time = $interval->format('%m');
return $time;
if(strtotime($date1)>strtotime($date2)){
$tmp=$date2;
$date2=$date1;
$date1=$tmp;
}
list($Y1,$m1,$d1)=explode('-',$date1);
list($Y2,$m2,$d2)=explode('-',$date2);
$y=$Y2-$Y1;
$m=$m2-$m1;
$d=$d2-$d1;
if($d<0){
$d+=(int)date('t',strtotime("-1 month $date2"));
$m--;
}
if($m<0){
$m+=12;
$y--;
}
return $m+1;
}
//

Loading…
Cancel
Save