no message

This commit is contained in:
hellcat 2026-01-09 15:58:23 +08:00
parent d5d89ed3ec
commit c3d963b37b

View File

@ -183,20 +183,29 @@ class ExecController extends Controller
} }
// 自动点赞 @cron // 自动点赞 @cron
public function likeAuto () public function likeAuto()
{ {
echo "\n#start# like auto \n"; echo "\n#start# like auto \n";
$iRand = rand(0, 3); $iRand = rand(0, 3);
// if ($iRand === 1) { if ($iRand > 0) {
$article = ArticleList::where('code', date('Ymd'))->first();
$r = ArticleList::where('code', date('Ymd')) if ($article) {
->increment('like', $iRand); // 使用 updateQuietly 避免触发 updated_at
$article->updateQuietly([
'like' => $article->like + $iRand
]);
echo $r; echo "like +{$iRand}\n";
} else {
echo "no article found\n";
}
} else {
echo "skip, rand=0\n";
}
// }
echo '\n';
echo "#end# like auto \n"; echo "#end# like auto \n";
} }