|
@@ -1555,15 +1555,11 @@ class LivingAllowance extends AdminController {
|
|
|
if (strpos($date, "-") !== false) {
|
|
|
$cDateArr = explode("-", $date);
|
|
|
$_date1 = date("Y-m-d", strtotime($cDateArr[0] . "01"));
|
|
|
- $month1 = date("n", strtotime($cDateArr[0] . "01"));
|
|
|
$_date2 = date("Y-m-d", strtotime($cDateArr[1] . "01"));
|
|
|
- $month2 = date("n", strtotime($cDateArr[1] . "01"));
|
|
|
- // 方法返回为相差月份
|
|
|
- $date1 = date_create($_date1);
|
|
|
- $date2 = date_create($_date2);
|
|
|
- $diff = date_diff($date1, $date2);
|
|
|
- if ($diff->invert != 1) {
|
|
|
- $count += $diff->y * 12 + ($month2 - $month1) + 1;
|
|
|
+ $currentDate = $_date1;
|
|
|
+ while ($currentDate <= $_date2) {
|
|
|
+ $count++;
|
|
|
+ $currentDate = date("Y-m-d", strtotime("+1 month", strtotime($currentDate)));
|
|
|
}
|
|
|
} else {
|
|
|
$count++;
|