afa 10 months ago
parent
commit
56e0cabd73
1 changed files with 6 additions and 1 deletions
  1. 6 1
      application/common/model/ProductPopular.php

+ 6 - 1
application/common/model/ProductPopular.php

@@ -45,7 +45,12 @@ class ProductPopular extends Model
         $count =0;
         $time = time();
         $list = self::where('status', '<', self::STOP)->select();
-        foreach ($list as $item) {
+        foreach ($list as $item) 
+        {
+            //未开始
+            if ( $item->start_time > $time)  {
+                $count += $item->allowField(true)->isUpdate(true)->save(['status'=>self::NOTSTOP]);
+            }
             //进行中
             if ($time >= $item->start_time && $time < $item->end_time)  {
                 $count += $item->allowField(true)->isUpdate(true)->save(['status'=>self::NORMAL]);