no message
This commit is contained in:
parent
fa0049d36c
commit
5df32ca888
@ -9,6 +9,7 @@ use App\Models\Config;
|
|||||||
use App\Models\LoginIp;
|
use App\Models\LoginIp;
|
||||||
use App\Models\Node;
|
use App\Models\Node;
|
||||||
use App\Models\OnlineLog;
|
use App\Models\OnlineLog;
|
||||||
|
use App\Models\Huodong;
|
||||||
use App\Services\Auth;
|
use App\Services\Auth;
|
||||||
use App\Services\Captcha;
|
use App\Services\Captcha;
|
||||||
use App\Services\Reward;
|
use App\Services\Reward;
|
||||||
@ -38,10 +39,20 @@ final class UserController extends BaseController
|
|||||||
if (Config::obtain('enable_checkin_captcha')) {
|
if (Config::obtain('enable_checkin_captcha')) {
|
||||||
$captcha = Captcha::generate();
|
$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(
|
return $response->write(
|
||||||
$this->view()
|
$this->view()
|
||||||
->assign('ann', (new Ann())->orderBy('date', 'desc')->first())
|
->assign('ann', $oAnn)
|
||||||
->assign('captcha', $captcha)
|
->assign('captcha', $captcha)
|
||||||
->assign('class_expire_days', $class_expire_days)
|
->assign('class_expire_days', $class_expire_days)
|
||||||
->assign('UniversalSub', Subscribe::getUniversalSubLink($this->user))
|
->assign('UniversalSub', Subscribe::getUniversalSubLink($this->user))
|
||||||
|
|||||||
@ -6,30 +6,18 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Query\Builder;
|
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
|
final class Huodong extends Model
|
||||||
{
|
{
|
||||||
protected $connection = 'default';
|
protected $connection = 'default';
|
||||||
protected $table = 'huodong';
|
protected $table = 'huodong';
|
||||||
|
|
||||||
// public function type(): string
|
public static function DateHit($sDate = null)
|
||||||
// {
|
{
|
||||||
// return match ($this->type) {
|
$sDate = $sDate ?? date("Y-m-d");
|
||||||
// 'howto' => '使用',
|
|
||||||
// 'billing' => '财务',
|
$oHuodong = self::where("start_date", "<=", $sDate)->where("end_date", ">=", $sDate)->first();
|
||||||
// 'account' => '账户',
|
|
||||||
// default => '其他',
|
return $oHuodong;
|
||||||
// };
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user