no message

This commit is contained in:
hellcat 2025-05-01 17:50:09 +08:00
parent fa0049d36c
commit 5df32ca888
2 changed files with 21 additions and 22 deletions

View File

@ -9,6 +9,7 @@ use App\Models\Config;
use App\Models\LoginIp;
use App\Models\Node;
use App\Models\OnlineLog;
use App\Models\Huodong;
use App\Services\Auth;
use App\Services\Captcha;
use App\Services\Reward;
@ -38,10 +39,20 @@ final class UserController extends BaseController
if (Config::obtain('enable_checkin_captcha')) {
$captcha = Captcha::generate();
}
$oAnn = (new Ann())->orderBy('date', 'desc')->first();
$oHuodong = Huodong::DateHit();
$sHuodongStr = $oHuodong->title."".$oHuodong->content;
$oAnn->content = str_replace("{{huodong}}", $sHuodongStr, $oAnn->content);
$oAnn->date = date("Y-m-d", strtotime($oAnn->date));
return $response->write(
$this->view()
->assign('ann', (new Ann())->orderBy('date', 'desc')->first())
->assign('ann', $oAnn)
->assign('captcha', $captcha)
->assign('class_expire_days', $class_expire_days)
->assign('UniversalSub', Subscribe::getUniversalSubLink($this->user))

View File

@ -6,30 +6,18 @@ namespace App\Models;
use Illuminate\Database\Query\Builder;
/**
* @property int $id 工单ID
* @property string $title 工单标题
* @property string $content 工单内容
* @property int $userid 用户ID
* @property int $datetime 创建时间
* @property string $status 工单状态
* @property string $type 工单类型
*
* @mixin Builder
*/
final class Huodong extends Model
{
protected $connection = 'default';
protected $table = 'huodong';
// public function type(): string
// {
// return match ($this->type) {
// 'howto' => '使用',
// 'billing' => '财务',
// 'account' => '账户',
// default => '其他',
// };
// }
public static function DateHit($sDate = null)
{
$sDate = $sDate ?? date("Y-m-d");
$oHuodong = self::where("start_date", "<=", $sDate)->where("end_date", ">=", $sDate)->first();
return $oHuodong;
}
}