Browse Source

语法错误

lizhen_gitee 1 year ago
parent
commit
b4114f8d58
1 changed files with 3 additions and 3 deletions
  1. 3 3
      application/api/controller/company/Index.php

+ 3 - 3
application/api/controller/company/Index.php

@@ -215,9 +215,9 @@ class Index extends Apic
             }
 
 
-            for($i=5;$i>=0;$i-=1){
+            for($i=5;$i>=0;$i--){
                 $starttime_i = strtotime("-".$i." month",$thismonth);
-                $endtime_i = strtotime("-".$i+1 ." month",$thismonth) - 1;
+                $endtime_i = strtotime("-".($i+1) ." month",$thismonth) - 1;
                 //日历
                 $ec_date[] = date('m',$starttime_i).'月';
                 //dump(date('Y-m-d H:i:s',$starttime_i));
@@ -231,7 +231,7 @@ class Index extends Apic
                 $val['textColor'] = '#FFFFFF';
                 for($i=5;$i>=0;$i-=1){
                     $starttime_i = strtotime("-".$i." month",$thismonth);
-                    $endtime_i = strtotime("-".$i+1 ." month",$thismonth) - 1;
+                    $endtime_i = strtotime("-".($i+1) ." month",$thismonth) - 1;
                     //销售金额
                     $map['finish_time'] = ['between',[$starttime_i,$endtime_i]];
                     $val['data'][] = Db::name('order')->where($map)->sum('total_fee');