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
c6c70bf5
Commit
c6c70bf5
authored
May 21, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3D试戴订阅消息优化完结
parent
57a6c175
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
15 deletions
+16
-15
AiTryon.php
addons/shopro/controller/user/AiTryon.php
+3
-3
AiImgGen.php
addons/shopro/job/AiImgGen.php
+11
-10
AiVideoRetry.php
addons/shopro/job/AiVideoRetry.php
+2
-2
No files found.
addons/shopro/controller/user/AiTryon.php
View file @
c6c70bf5
...
@@ -82,9 +82,9 @@ class AiTryon extends Common
...
@@ -82,9 +82,9 @@ class AiTryon extends Common
$user
=
auth_user
();
$user
=
auth_user
();
//开发过程中临时调试代码
//开发过程中临时调试代码
\think\Queue
::
push
(
'\addons\shopro\job\AiImgGen@exec'
,
[
'user'
=>
$user
->
toArray
(),
'id'
=>
245
],
'shopro-high'
);
//
\think\Queue::push('\addons\shopro\job\AiImgGen@exec', ['user' => $user->toArray(), 'id' => 245 ], 'shopro-high');
$this
->
success
(
'推送队列成功777'
);
//
$this->success('推送队列成功777');
exit
;
//
exit;
// $this->success('图片生成成功', 'https://zhubaoshop.sydggxs.com/uploads/20260508/c92396f646bd41887329891647fcfcaf.png');
// $this->success('图片生成成功', 'https://zhubaoshop.sydggxs.com/uploads/20260508/c92396f646bd41887329891647fcfcaf.png');
// 校验商品分类是否在允许试戴分类中
// 校验商品分类是否在允许试戴分类中
...
...
addons/shopro/job/AiImgGen.php
View file @
c6c70bf5
...
@@ -28,15 +28,16 @@ class AiImgGen extends BaseJob
...
@@ -28,15 +28,16 @@ class AiImgGen extends BaseJob
$user
=
$data
[
'user'
];
$user
=
$data
[
'user'
];
$user_id
=
isset
(
$user
[
'id'
])
?
$user
[
'id'
]
:
0
;
$user_id
=
isset
(
$user
[
'id'
])
?
$user
[
'id'
]
:
0
;
try
{
// 开发中的 调试代码
$aiService
=
new
Ai
();
// try{
$aiService
->
sendNotification
(
$user_id
,
$id
);
// $aiService = new Ai();
$this
->
debug_log
(
'消息发送成功666'
);
// $aiService->sendNotification($user_id, $id);
$job
->
delete
();
// $this->debug_log('消息发送成功666');
}
catch
(
\Exception
$e
)
{
// $job->delete();
format_log_error_custom_name
(
$e
,
'[AI图片发现消息异常]'
,
''
,
'gen_ai'
);
// } catch (\Exception $e) {
}
// format_log_error_custom_name($e, '[AI图片发现消息异常]', '', 'gen_ai');
exit
;
// }
// exit;
$this
->
debug_log
(
'***************************** '
.
date
(
'Y-m-d H:i:s'
)
.
'[AI图片异步队列]AI图片生成脚本开始 userid '
.
$user_id
.
' id:'
.
$id
.
' ***********************************'
.
PHP_EOL
);
$this
->
debug_log
(
'***************************** '
.
date
(
'Y-m-d H:i:s'
)
.
'[AI图片异步队列]AI图片生成脚本开始 userid '
.
$user_id
.
' id:'
.
$id
.
' ***********************************'
.
PHP_EOL
);
...
@@ -88,7 +89,7 @@ class AiImgGen extends BaseJob
...
@@ -88,7 +89,7 @@ class AiImgGen extends BaseJob
return
false
;
return
false
;
}
}
AiTryOnModel
::
where
(
'id'
,
$id
)
->
where
(
'user_id'
,
$user_id
)
->
update
([
'ai_status'
=>
1
,
'ai_url'
=>
config
(
'shopro.api_host'
)
.
$attachment
]);
AiTryOnModel
::
where
(
'id'
,
$id
)
->
where
(
'user_id'
,
$user_id
)
->
update
([
'ai_status'
=>
1
,
'ai_
err_msg'
=>
'图片已成功'
,
'ai_
url'
=>
config
(
'shopro.api_host'
)
.
$attachment
]);
// 发送消息通知
// 发送消息通知
$aiService
->
sendNotification
(
$user_id
,
$id
);
$aiService
->
sendNotification
(
$user_id
,
$id
);
...
...
addons/shopro/job/AiVideoRetry.php
View file @
c6c70bf5
...
@@ -19,7 +19,7 @@ class AiVideoRetry extends BaseJob
...
@@ -19,7 +19,7 @@ class AiVideoRetry extends BaseJob
// 调试日志 && 自定义日志
// 调试日志 && 自定义日志
private
function
debug_log
(
$text
=
''
){
private
function
debug_log
(
$text
=
''
){
debug_echo
(
$text
);
//
debug_echo($text);
custom_log
(
$text
,
'gen_ai'
);
custom_log
(
$text
,
'gen_ai'
);
}
}
...
@@ -112,7 +112,7 @@ class AiVideoRetry extends BaseJob
...
@@ -112,7 +112,7 @@ class AiVideoRetry extends BaseJob
}
}
// 更新我的试戴记录
// 更新我的试戴记录
AiTryOnModel
::
where
(
'user_id'
,
$user_id
)
->
where
(
'ai_task_id'
,
$taskid
)
->
update
([
'ai_status'
=>
1
,
'ai_url'
=>
config
(
'shopro.api_host'
)
.
$video_url
,
'ai_err_msg'
=>
'视频
生成成功
'
]);
AiTryOnModel
::
where
(
'user_id'
,
$user_id
)
->
where
(
'ai_task_id'
,
$taskid
)
->
update
([
'ai_status'
=>
1
,
'ai_url'
=>
config
(
'shopro.api_host'
)
.
$video_url
,
'ai_err_msg'
=>
'视频
已完成
'
]);
$this
->
debug_log
(
'[AI视频查询异步队列]保存本地视频成功 sql: '
.
db
()
->
getLastSql
());
$this
->
debug_log
(
'[AI视频查询异步队列]保存本地视频成功 sql: '
.
db
()
->
getLastSql
());
// 发送成功消息通知
// 发送成功消息通知
...
...
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