Files
mini_tp/app/api/model/MemberLoginLog.php
T
nepiedg 6b46767d86 refactor(member, auth): streamline product info retrieval and enhance dashboard statistics
- Updated `getProductInfo` method in `Member` model to use a unified model for fetching product data.
- Refactored `logLogin` method to utilize `MemberLoginLog` for logging login attempts.
- Introduced `getDashboardStats` method in `AuthService` to gather user-specific statistics, including remaining quotas and counts of authorized accounts, published tasks, and works.
- Added new database configuration for Douyin business statistics.
2026-04-02 07:09:29 +00:00

33 lines
648 B
PHP

<?php
declare(strict_types=1);
namespace app\api\model;
use think\Model;
/**
* 会员登录日志模型(对应 member_login_log 表)
*
* 这里封装登录日志写入,避免业务层直接拼接表名。
*/
class MemberLoginLog extends Model
{
protected $connection = 'dbmember';
protected $name = 'member_login_log';
protected $autoWriteTimestamp = false;
/**
* 记录一次登录结果。
*
* @param array $payload 登录日志字段
* @return void
*/
public static function recordLogin(array $payload): void
{
$model = new self();
$model->save($payload);
}
}