黄宗昌 2 years ago
parent
commit
ee43e41fe3
1 changed files with 3 additions and 3 deletions
  1. 3 3
      app/Admin/Metrics/Examples/NewProduct.php

+ 3 - 3
app/Admin/Metrics/Examples/NewProduct.php

@@ -98,13 +98,13 @@ class NewProduct extends Line
             $count = 8;
             $count = 8;
         }
         }
         //统计会员总数
         //统计会员总数
-        $t_now = date('Y-m-d');
+        $t_now = date('Y-m-d H:s:i');
         $num = Product::query()->whereBetween('created_at',array($t_last,$t_now))->count();
         $num = Product::query()->whereBetween('created_at',array($t_last,$t_now))->count();
         //计算会员增长数量
         //计算会员增长数量
         for ($i=1 ; $i < $count; $i++) {
         for ($i=1 ; $i < $count; $i++) {
             $today=strtotime(date('Ymd'));
             $today=strtotime(date('Ymd'));
-            $start_time = date('Y-m-d',$today-$t_time*$i);
-            $end_time  = date('Y-m-d',$today-$t_time*($i-1));
+            $start_time = date('Y-m-d 23:59:59',$today-$t_time*$i);
+            $end_time  = date('Y-m-d 23:59:59',$today-$t_time*($i-1));
             $inc_num = Product::query()->whereBetween('created_at',[$start_time,$end_time])->count();
             $inc_num = Product::query()->whereBetween('created_at',[$start_time,$end_time])->count();
             //$arr_t[]=$now;
             //$arr_t[]=$now;
             $arr_n[]=$inc_num;
             $arr_n[]=$inc_num;