|
|
@@ -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]);
|