6b46767d86
- 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.
33 lines
648 B
PHP
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);
|
|
}
|
|
}
|