|
|
@@ -580,8 +580,16 @@ class Period extends \common\components\ActiveRecord
|
|
|
if($period){
|
|
|
$year = $period['CALC_YEAR'];
|
|
|
$month = $period['CALC_MONTH'];
|
|
|
- $lastYear = Date::lastMonth($year.'-'.$month, 'Y');
|
|
|
- $lastMonth = Date::lastMonth($year.'-'.$month, 'm');
|
|
|
+ if($month=='13'){
|
|
|
+ $lastYear = $year;
|
|
|
+ $lastMonth = '12';
|
|
|
+ } else if($month=='1'){
|
|
|
+ $lastYear = Date::lastMonth($year.'-'.$month,'Y');
|
|
|
+ $lastMonth = '13';
|
|
|
+ } else {
|
|
|
+ $lastYear = Date::lastMonth($year.'-'.$month, 'Y');
|
|
|
+ $lastMonth = Date::lastMonth($year.'-'.$month, 'm');
|
|
|
+ }
|
|
|
return [
|
|
|
'year' => $lastYear,
|
|
|
'month' => intval($lastMonth),
|