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.
36 lines
731 B
PHP
36 lines
731 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace app\api\model;
|
|
|
|
use think\Model;
|
|
|
|
/**
|
|
* 授权账号模型(对应 dy_video_user 表)
|
|
*
|
|
* 首页“授权账号”卡片按 acgpmw 首页逻辑统计未禁用账号数。
|
|
*/
|
|
class DyVideoUser extends Model
|
|
{
|
|
protected $connection = 'dbmember';
|
|
|
|
protected $name = 'dy_video_user';
|
|
|
|
protected $pk = 'id';
|
|
|
|
protected $autoWriteTimestamp = false;
|
|
|
|
/**
|
|
* 统计当前用户可用的授权账号数量。
|
|
*
|
|
* @param int $userid 用户ID
|
|
* @return int
|
|
*/
|
|
public static function countActiveByUserId(int $userid): int
|
|
{
|
|
return (int) self::where('userid', $userid)
|
|
->where('disabled', 0)
|
|
->count();
|
|
}
|
|
}
|