feat: 新增
This commit is contained in:
parent
06e3ed1d5e
commit
ba7204045f
|
@ -41,4 +41,10 @@ class UserPhone extends Model
|
||||||
*/
|
*/
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'user_id',
|
||||||
|
'phome',
|
||||||
|
'income',
|
||||||
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,12 +47,12 @@ class Task4
|
||||||
// echo date('Y-m-d H:i:s')."\n";
|
// echo date('Y-m-d H:i:s')."\n";
|
||||||
// });
|
// });
|
||||||
// // 每天凌晨0点执行
|
// // 每天凌晨0点执行
|
||||||
new Crontab('0 0 * * *', function () {
|
new Crontab('*/5 * * * * *', function () {
|
||||||
echo date('Y-m-d H:i:s')."\n";
|
echo date('Y-m-d H:i:s')."\n";
|
||||||
//把user里所有数据的today_num全部变成0
|
//把user里所有数据的today_num全部变成0
|
||||||
User::where('today_num','>',0)->update(['today_num'=>0]);
|
User::where('today_num','>',0)->update(['today_num'=>0]);
|
||||||
User::where('active_figures','>',0)->update(['active_figures'=>0]);
|
User::where('active_figures','>',0)->update(['active_figures'=>0]);
|
||||||
UserPhone::all()->update(['day_score'=>0]);
|
UserPhone::query()->update(['day_score' => 0]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue