Commit d4f6b21b authored by 刘小敏's avatar 刘小敏

feat: add daily 3D try-on count limit config and use it

首先在配置文件中新增ai_tryon_count配置项,默认值为2,然后在用户试戴权限校验逻辑中使用该配置项替代硬编码的2,方便后续调整限制次数。
parent dd89931f
......@@ -45,7 +45,8 @@ class User
// 查询我的试戴列表
$res = userModel::where('id', $user_id)
->find();
if ($res->ai_count > 2 && $res->ai_time > Time::today()[0]) {
$ai_tryon_count = config('shopro.ai_tryon_count');
if ($res->ai_count > $ai_tryon_count && $res->ai_time > Time::today()[0]) {
return 0; // 不可以试戴
} else {
return 1; // 可以试戴
......
......@@ -327,6 +327,9 @@ return [
'ai_clip' => Env::get('app.ai_clip', ''),
'ai_mix' => Env::get('app.ai_mix', ''),
'ai_hook' => Env::get('app.ai_hook', ''),
// 每天3D试戴次数上限
'ai_tryon_count' => Env::get('app.ai_tryon_count', 2),
// obs 配置
'obs_access_key' => 'HPUAWU3GPS8HEWX9JFLG',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment