Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘小敏
loveisland
Commits
9b164bb3
Commit
9b164bb3
authored
May 20, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AI视频脚本增加去重逻辑
parent
823044e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
AiVideoGen.php
addons/shopro/job/AiVideoGen.php
+17
-15
AiVideoRetry.php
addons/shopro/job/AiVideoRetry.php
+1
-1
No files found.
addons/shopro/job/AiVideoGen.php
View file @
9b164bb3
...
@@ -46,6 +46,23 @@ class AiVideoGen extends BaseJob
...
@@ -46,6 +46,23 @@ class AiVideoGen extends BaseJob
return
false
;
return
false
;
}
}
// 去重处理
$tryon
=
AiTryOnModel
::
where
(
'id'
,
$id
)
->
find
();
// 检查记录是否存在
if
(
!
$tryon
)
{
$this
->
debug_log
(
'[AI视频生成异步队列][删除Job]试戴记录不存在: id='
.
$id
);
$job
->
delete
();
return
false
;
}
// 检查是否已有任务ID(去重)
if
(
!
empty
(
$tryon
[
'ai_task_id'
])
||
$tryon
[
'ai_status'
]
!==
0
)
{
$this
->
debug_log
(
'[AI视频生成异步队列][删除Job]已有任务ID,跳过: id='
.
$id
.
', task_id='
.
$tryon
[
'ai_task_id'
]);
$job
->
delete
();
return
false
;
}
// 1. 合成AI视频,返回任务ID
// 1. 合成AI视频,返回任务ID
$ai
=
new
Ai
();
$ai
=
new
Ai
();
$res
=
$ai
->
generateVideo
(
$id
,
$user_id
);
$res
=
$ai
->
generateVideo
(
$id
,
$user_id
);
...
@@ -65,21 +82,6 @@ class AiVideoGen extends BaseJob
...
@@ -65,21 +82,6 @@ class AiVideoGen extends BaseJob
// 去重处理
// 去重处理
$taskid
=
$res
[
'data'
];
$taskid
=
$res
[
'data'
];
$tryon
=
AiTryOnModel
::
where
(
'id'
,
$id
)
->
find
();
// 检查记录是否存在
if
(
!
$tryon
)
{
$this
->
debug_log
(
'[AI视频生成][删除Job]试戴记录不存在: id='
.
$id
);
$job
->
delete
();
return
false
;
}
// 检查是否已有任务ID(去重)
if
(
!
empty
(
$tryon
[
'ai_task_id'
]))
{
$this
->
debug_log
(
'[AI视频生成][删除Job]已有任务ID,跳过: id='
.
$id
.
', task_id='
.
$tryon
[
'ai_task_id'
]);
$job
->
delete
();
return
false
;
}
// 更新任务ID和状态
// 更新任务ID和状态
AiTryOnModel
::
where
(
'id'
,
$id
)
->
update
([
AiTryOnModel
::
where
(
'id'
,
$id
)
->
update
([
...
...
addons/shopro/job/AiVideoRetry.php
View file @
9b164bb3
...
@@ -44,7 +44,7 @@ class AiVideoRetry extends BaseJob
...
@@ -44,7 +44,7 @@ class AiVideoRetry extends BaseJob
$user
=
$data
[
'user'
];
$user
=
$data
[
'user'
];
$user_id
=
isset
(
$user
[
'id'
])
?
$user
[
'id'
]
:
0
;
$user_id
=
isset
(
$user
[
'id'
])
?
$user
[
'id'
]
:
0
;
$this
->
debug_log
(
'***************************** '
.
date
(
'Y-m-d H:i:s'
)
.
'查询AI视频状态脚本开始 userid '
.
$user_id
.
' taskid:'
.
$taskid
.
' id:'
.
$id
.
' ***********************************'
.
PHP_EOL
);
$this
->
debug_log
(
'***************************** '
.
date
(
'Y-m-d H:i:s'
)
.
'
[AI视频查询异步队列]
查询AI视频状态脚本开始 userid '
.
$user_id
.
' taskid:'
.
$taskid
.
' id:'
.
$id
.
' ***********************************'
.
PHP_EOL
);
// 校验入参
// 校验入参
if
(
empty
(
$id
)
||
empty
(
$user_id
)
||
empty
(
$taskid
))
{
if
(
empty
(
$id
)
||
empty
(
$user_id
)
||
empty
(
$taskid
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment