Files
code-bang/backend/application/common/service/SoftCodeService.php
T

30 lines
599 B
PHP
Raw Normal View History

2026-09-17 16:25:31 +08:00
<?php
namespace app\common\service;
use app\common\model\soft\Codes as SoftCodes;
use think\Cache;
use think\Exception;
use app\common\traits\ServiceTrait;
class SoftCodeService
{
use ServiceTrait;
/** @var SoftCodes */
public static $Model = SoftCodes::class;
/**
* 获取可用激活码
* @throws \Exception
*/
public static function getAvailableCode()
{
$res = self::getOne(['status' => CommonService::NO]);
if (!$res) {
exception('激活码不足,请手动生成');
}
return $res->activate_code;
}
}