This commit is contained in:
lingling 2025-02-22 21:31:02 +08:00
commit b5daafd762
2 changed files with 8 additions and 2 deletions

View File

@ -41,4 +41,10 @@ class UserPhone extends Model
*/
public $timestamps = true;
protected $fillable = [
'user_id',
'phome',
'income',
];
}

View File

@ -47,12 +47,12 @@ class Task4
// echo date('Y-m-d H:i:s')."\n";
// });
// // 每天凌晨0点执行
new Crontab('0 0 * * *', function () {
new Crontab('0 0 0 * * *', function () {
echo date('Y-m-d H:i:s')."\n";
//把user里所有数据的today_num全部变成0
User::where('today_num','>',0)->update(['today_num'=>0]);
User::where('active_figures','>',0)->update(['active_figures'=>0]);
UserPhone::all()->update(['day_score'=>0]);
UserPhone::query()->update(['day_score' => 0]);
});
}
}