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
57a6c175
Commit
57a6c175
authored
May 21, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3D试戴订阅消息优化
parent
b31b06e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
AiTryon.php
addons/shopro/controller/user/AiTryon.php
+14
-9
AiImgGen.php
addons/shopro/job/AiImgGen.php
+11
-0
AiVideoSuccess.php
addons/shopro/notification/ai/AiVideoSuccess.php
+1
-1
No files found.
addons/shopro/controller/user/AiTryon.php
View file @
57a6c175
...
...
@@ -81,6 +81,12 @@ class AiTryon extends Common
$user
=
auth_user
();
//开发过程中临时调试代码
\think\Queue
::
push
(
'\addons\shopro\job\AiImgGen@exec'
,
[
'user'
=>
$user
->
toArray
(),
'id'
=>
245
],
'shopro-high'
);
$this
->
success
(
'推送队列成功777'
);
exit
;
// $this->success('图片生成成功', 'https://zhubaoshop.sydggxs.com/uploads/20260508/c92396f646bd41887329891647fcfcaf.png');
// 校验商品分类是否在允许试戴分类中
$goodsService
=
new
GoodsService
();
$is_allowed
=
$goodsService
->
isCategoryAllowed
(
''
,
$params
[
'goods_id'
]);
...
...
@@ -89,9 +95,6 @@ class AiTryon extends Common
$this
->
error
(
'商品所属分类不允许试戴'
);
}
//开发过程中临时代码,AI图片生成次数有限
// $this->success('图片生成成功', 'https://zhubaoshop.sydggxs.com/uploads/20260508/c92396f646bd41887329891647fcfcaf.png');
// 校验试戴次数 && 扣除积分
$userService
=
new
User
();
$res
=
$userService
->
isTry
(
$user
->
id
);
...
...
@@ -118,6 +121,7 @@ class AiTryon extends Common
'ai_type'
=>
0
,
'ai_status'
=>
0
,
'ai_url'
=>
''
,
'createtime'
=>
time
()
];
$id
=
$tryonModel
->
insertGetId
(
$tryonData
);
...
...
@@ -169,6 +173,12 @@ class AiTryon extends Common
$user
=
auth_user
();
//开发过程中临时调试代码
// \think\Queue::push('\addons\shopro\job\AiVideoGen@save', ['taskid' => 'cgt-20260518151431-zcrgp', 'user' => $user, 'id'=> 214], 'shopro-high');
// $this->success('推送队列成功');
// exit;
// $this->success('视频生成中', 13);
// 校验商品分类是否在允许试戴分类中
$goodsService
=
new
GoodsService
();
$is_allowed
=
$goodsService
->
isCategoryAllowed
(
''
,
$params
[
'goods_id'
]);
...
...
@@ -177,12 +187,6 @@ class AiTryon extends Common
$this
->
error
(
'商品所属分类不允许试戴'
);
}
//开发过程中临时调试代码
// \think\Queue::push('\addons\shopro\job\AiVideoGen@save', ['taskid' => 'cgt-20260518151431-zcrgp', 'user' => $user, 'id'=> 214], 'shopro-high');
// $this->success('推送队列成功');
// exit;
// $this->success('视频生成中', 13);
// 校验试戴次数 && 扣除积分
$userService
=
new
User
();
$res
=
$userService
->
isTry
(
$user
->
id
);
...
...
@@ -208,6 +212,7 @@ class AiTryon extends Common
'ai_type'
=>
1
,
'ai_status'
=>
0
,
'ai_task_id'
=>
''
,
'createtime'
=>
time
()
];
$id
=
$tryonModel
->
insertGetId
(
$tryonData
);
...
...
addons/shopro/job/AiImgGen.php
View file @
57a6c175
...
...
@@ -5,6 +5,7 @@ namespace addons\shopro\job;
use
addons\shopro\service\user\Ai
;
use
app\admin\model\shopro\AiTryon
as
AiTryOnModel
;
use
think\queue\Job
;
use
addons\shopro\job\BaseJob
;
/**
* AI生成图片
...
...
@@ -27,6 +28,16 @@ class AiImgGen extends BaseJob
$user
=
$data
[
'user'
];
$user_id
=
isset
(
$user
[
'id'
])
?
$user
[
'id'
]
:
0
;
try
{
$aiService
=
new
Ai
();
$aiService
->
sendNotification
(
$user_id
,
$id
);
$this
->
debug_log
(
'消息发送成功666'
);
$job
->
delete
();
}
catch
(
\Exception
$e
)
{
format_log_error_custom_name
(
$e
,
'[AI图片发现消息异常]'
,
''
,
'gen_ai'
);
}
exit
;
$this
->
debug_log
(
'***************************** '
.
date
(
'Y-m-d H:i:s'
)
.
'[AI图片异步队列]AI图片生成脚本开始 userid '
.
$user_id
.
' id:'
.
$id
.
' ***********************************'
.
PHP_EOL
);
// 校验入参
...
...
addons/shopro/notification/ai/AiVideoSuccess.php
View file @
57a6c175
...
...
@@ -48,7 +48,7 @@ class AiVideoSuccess extends Notification
'WechatMiniProgram'
=>
[
'category_id'
=>
670
,
'tid'
=>
''
,
// 需要在后台配置模板ID
'kid'
=>
[
1
,
2
,
3
],
'kid'
=>
[
2
,
6
,
7
],
'scene_desc'
=>
'3D试戴成功通知用户'
,
'fields'
=>
[
[
...
...
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