Files
mini_tp/app/api/model/DyVideoUser.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

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();
}
}