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
49793a7e
Commit
49793a7e
authored
May 18, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3D试戴消息通知 调试
parent
8df939bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
8 deletions
+32
-8
AiVideoGen.php
addons/shopro/job/AiVideoGen.php
+15
-5
AiVideoSuccess.php
addons/shopro/notification/ai/AiVideoSuccess.php
+17
-3
No files found.
addons/shopro/job/AiVideoGen.php
View file @
49793a7e
...
...
@@ -124,11 +124,18 @@ class AiVideoGen extends BaseJob
*/
public
function
save
(
Job
$job
,
$data
)
{
try
{
$taskid
=
$data
[
'taskid'
];
$user
=
$data
[
'user'
];
$user_id
=
isset
(
$user
[
'id'
])
?
$user
[
'id'
]
:
0
;
$this
->
debug_log
(
'***************************** 保存AI视频脚本开始 userid '
.
$user_id
.
' taskid:'
.
$taskid
.
' ***********************************'
.
PHP_EOL
);
$this
->
debug_log
(
'***************************** '
.
date
(
'Y-m-d H:i:s'
)
.
'保存AI视频脚本开始 userid '
.
$user_id
.
' taskid:'
.
$taskid
.
' ***********************************'
.
PHP_EOL
);
$this
->
sendNotification
(
$user_id
,
$taskid
);
// 删除队列job
$this
->
debug_log
(
'[AI视频]删除Job'
);
$job
->
delete
();
exit
;
if
(
!
isset
(
$taskid
)
||
empty
(
$taskid
)
||
!
isset
(
$user_id
)
||
empty
(
$user_id
))
{
...
...
@@ -283,18 +290,21 @@ class AiVideoGen extends BaseJob
->
find
();
// 发送通知
$user
=
User
::
where
(
'id'
,
$user_id
)
->
find
();
// $user = User::where('id', $user_id)->find();
print_r
(
$aiTryon
->
toArray
());
print_r
(
$user
->
toArray
());
$user
&&
$user
->
notify
(
new
AiVideoSuccess
([
'ai_tryon'
=>
$aiTryon
?
$aiTryon
->
toArray
()
:
[],
'user'
=>
$
user
->
toArray
()
'user'
=>
$
aiTryon
?
$user
->
toArray
()
:
[]
])
);
$this
->
debug_log
(
'[AI视频
通知]通知发送成功: user_id='
.
$user_
id
);
$this
->
debug_log
(
'[AI视频
]通知发送成功: user_id='
.
$user_id
.
' taskid='
.
$task
id
);
return
true
;
}
catch
(
\Exception
$e
)
{
$this
->
debug_log
(
'[AI视频
通知]发送失败: user_id='
.
$user_
id
.
' '
.
$e
->
getMessage
());
$this
->
debug_log
(
'[AI视频
]通知发送失败: user_id='
.
$user_id
.
' taskid='
.
$task
id
.
' '
.
$e
->
getMessage
());
return
false
;
}
}
...
...
addons/shopro/notification/ai/AiVideoSuccess.php
View file @
49793a7e
...
...
@@ -59,7 +59,17 @@ class AiVideoSuccess extends Notification
[
"name"
=>
"生成时间"
,
"field"
=>
"create_time"
,
"template_field"
=>
"time2"
,
"template_field"
=>
"time3"
,
],
[
"name"
=>
"试戴结果"
,
"field"
=>
"ai_err_msg"
,
"template_field"
=>
"phrase2"
,
],
[
"name"
=>
"商品名称"
,
"field"
=>
"goods_title"
,
"template_field"
=>
"thing1"
,
]
],
]
...
...
@@ -76,6 +86,8 @@ class AiVideoSuccess extends Notification
[
'name'
=>
'视频链接'
,
'field'
=>
'video_url'
],
[
'name'
=>
'用户昵称'
,
'field'
=>
'nickname'
],
[
'name'
=>
'用户手机'
,
'field'
=>
'mobile'
],
[
'name'
=>
'试戴结果'
,
'field'
=>
'ai_err_msg'
],
[
'name'
=>
'商品名称'
,
'field'
=>
'goods_title'
],
]
];
...
...
@@ -92,13 +104,15 @@ class AiVideoSuccess extends Notification
$data
[
'template'
]
=
$this
->
returnField
[
'name'
];
$data
[
'status'
]
=
'生成成功'
;
$data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
,
$aiTryon
[
'create_time'
]
);
$data
[
'video_url'
]
=
$aiTryon
[
'ai_url'
]
??
''
;
$data
[
'goods_title'
]
=
$aiTryon
[
'goods_title'
]
??
''
;
$data
[
'ai_err_msg'
]
=
$aiTryon
[
'ai_err_msg'
]
??
''
;
$data
[
'nickname'
]
=
$user
[
'nickname'
]
??
''
;
$data
[
'mobile'
]
=
$user
[
'mobile'
]
??
''
;
// 小程序跳转地址
$data
[
'jump_url'
]
=
"
/
pages/user/tryOnRecord"
;
$data
[
'jump_url'
]
=
"pages/user/tryOnRecord"
;
return
$data
;
}
...
...
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