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
00b514ba
Commit
00b514ba
authored
May 30, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加AI试戴商品图;日志权限配置;AI试戴成图片优化;
parent
059352bf
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
7 deletions
+52
-7
AiTryon.php
addons/shopro/controller/user/AiTryon.php
+40
-5
Ai.php
addons/shopro/service/user/Ai.php
+1
-0
Goods.php
application/admin/controller/shopro/goods/Goods.php
+2
-2
add.html
application/admin/view/shopro/goods/goods/add.html
+6
-0
config.php
application/config.php
+2
-0
goods.js
public/assets/js/backend/shopro/goods/goods.js
+1
-0
No files found.
addons/shopro/controller/user/AiTryon.php
View file @
00b514ba
...
@@ -74,6 +74,9 @@ class AiTryon extends Common
...
@@ -74,6 +74,9 @@ class AiTryon extends Common
if
(
!
$this
->
request
->
isPost
())
{
if
(
!
$this
->
request
->
isPost
())
{
$this
->
error
(
''
);
$this
->
error
(
''
);
}
}
try
{
$params
=
$this
->
request
->
only
([
$params
=
$this
->
request
->
only
([
'person_image'
,
'jewelry_image'
,
'goods_id'
,
'goods_title'
,
'goods_subtitle'
'person_image'
,
'jewelry_image'
,
'goods_id'
,
'goods_title'
,
'goods_subtitle'
]);
]);
...
@@ -82,10 +85,10 @@ class AiTryon extends Common
...
@@ -82,10 +85,10 @@ 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');
// 校验商品分类是否在允许试戴分类中
// 校验商品分类是否在允许试戴分类中
$goodsService
=
new
GoodsService
();
$goodsService
=
new
GoodsService
();
...
@@ -133,6 +136,10 @@ class AiTryon extends Common
...
@@ -133,6 +136,10 @@ class AiTryon extends Common
$this
->
success
(
'图片生成中'
,
$id
);
$this
->
success
(
'图片生成中'
,
$id
);
}
catch
(
\Exception
$e
)
{
format_log_error_custom_name
(
$e
,
'[AI生成图片接口]'
,
''
,
'gen_ai'
);
$this
->
error
(
'生成失败: '
.
$e
->
getMessage
());
}
}
}
/**
/**
...
@@ -146,7 +153,7 @@ class AiTryon extends Common
...
@@ -146,7 +153,7 @@ class AiTryon extends Common
$res
=
AiTryOnModel
::
get
(
$params
[
'id'
]);
$res
=
AiTryOnModel
::
get
(
$params
[
'id'
]);
switch
(
$res
->
ai_status
){
switch
(
$res
->
ai_status
){
case
0
:
case
0
:
$this
->
success
(
'
IA
结果生成中'
);
$this
->
success
(
'
AI
结果生成中'
);
break
;
break
;
case
1
:
case
1
:
$this
->
success
(
'AI试戴详情'
,
$res
);
$this
->
success
(
'AI试戴详情'
,
$res
);
...
@@ -227,4 +234,32 @@ class AiTryon extends Common
...
@@ -227,4 +234,32 @@ class AiTryon extends Common
}
}
/**
* 删除AI试戴记录(逻辑删除)
*/
public
function
delete
()
{
$params
=
$this
->
request
->
only
([
'id'
]);
$this
->
svalidate
(
$params
,
".aidetail"
);
$user
=
auth_user
();
// 查询试戴记录
$tryon
=
AiTryOnModel
::
where
(
'id'
,
$params
[
'id'
])
->
where
(
'user_id'
,
$user
->
id
)
->
where
(
'deletetime'
,
'null'
)
->
find
();
if
(
!
$tryon
)
{
$this
->
error
(
'记录不存在或已删除'
);
}
// 执行逻辑删除
$tryon
->
deletetime
=
time
();
$tryon
->
save
();
$this
->
success
(
'删除成功'
);
}
}
}
addons/shopro/service/user/Ai.php
View file @
00b514ba
...
@@ -209,6 +209,7 @@ class Ai
...
@@ -209,6 +209,7 @@ class Ai
"response_format"
=>
$response_format
,
"response_format"
=>
$response_format
,
"size"
=>
"2K"
,
"size"
=>
"2K"
,
"num"
=>
1
,
"num"
=>
1
,
"watermark"
=>
false
,
],
],
'timeout'
=>
300
,
'timeout'
=>
300
,
'verify'
=>
false
,
// 关闭 SSL 证书验证
'verify'
=>
false
,
// 关闭 SSL 证书验证
...
...
application/admin/controller/shopro/goods/Goods.php
View file @
00b514ba
...
@@ -116,7 +116,7 @@ class Goods extends Common
...
@@ -116,7 +116,7 @@ class Goods extends Common
}
}
$params
=
$this
->
request
->
only
([
$params
=
$this
->
request
->
only
([
'type'
,
'title'
,
'subtitle'
,
'category_ids'
,
'image'
,
'images'
,
'image_wh'
,
'params'
,
'type'
,
'title'
,
'subtitle'
,
'category_ids'
,
'image'
,
'images'
,
'image_wh'
,
'params'
,
'image_3d'
,
'original_price'
,
'price'
,
'is_sku'
,
'limit_type'
,
'limit_num'
,
'sales_show_type'
,
'original_price'
,
'price'
,
'is_sku'
,
'limit_type'
,
'limit_num'
,
'sales_show_type'
,
'stock_show_type'
,
'show_sales'
,
'service_ids'
,
'dispatch_type'
,
'dispatch_id'
,
'is_offline'
,
'status'
,
'weigh'
,
'stock_show_type'
,
'show_sales'
,
'service_ids'
,
'dispatch_type'
,
'dispatch_id'
,
'is_offline'
,
'status'
,
'weigh'
,
]);
// likes, views, sales,
]);
// likes, views, sales,
...
@@ -184,7 +184,7 @@ class Goods extends Common
...
@@ -184,7 +184,7 @@ class Goods extends Common
}
}
$params
=
$this
->
request
->
only
([
$params
=
$this
->
request
->
only
([
'type'
,
'title'
,
'subtitle'
,
'image'
,
'images'
,
'image_wh'
,
'params'
,
'type'
,
'title'
,
'subtitle'
,
'image'
,
'images'
,
'image_wh'
,
'params'
,
'category_ids'
,
'image_3d'
,
'original_price'
,
'price'
,
'is_sku'
,
'limit_type'
,
'limit_num'
,
'sales_show_type'
,
'original_price'
,
'price'
,
'is_sku'
,
'limit_type'
,
'limit_num'
,
'sales_show_type'
,
'stock_show_type'
,
'show_sales'
,
'service_ids'
,
'dispatch_type'
,
'dispatch_id'
,
'is_offline'
,
'status'
,
'weigh'
,
'recommend'
'stock_show_type'
,
'show_sales'
,
'service_ids'
,
'dispatch_type'
,
'dispatch_id'
,
'is_offline'
,
'status'
,
'weigh'
,
'recommend'
]);
// likes, views, sales,
]);
// likes, views, sales,
...
...
application/admin/view/shopro/goods/goods/add.html
View file @
00b514ba
...
@@ -341,6 +341,12 @@
...
@@ -341,6 +341,12 @@
作用于商品详情顶部轮播显示,
<br
/>
轮播图可以拖拽调整顺序
作用于商品详情顶部轮播显示,
<br
/>
轮播图可以拖拽调整顺序
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"3D试戴图"
prop=
"image_3d"
>
<sa-uploader
v-model=
"form.model.image_3d"
type=
"image"
></sa-uploader>
<div
class=
"warning"
>
用于AI试戴功能的商品图片
</div>
</el-form-item>
<el-form-item
label=
"商品分类"
>
<el-form-item
label=
"商品分类"
>
<div
class=
"sa-w-360"
>
<div
class=
"sa-w-360"
>
<el-popover
popper-class=
"category-tooltip sa-popper"
effect=
"light"
<el-popover
popper-class=
"category-tooltip sa-popper"
effect=
"light"
...
...
application/config.php
View file @
00b514ba
...
@@ -172,6 +172,8 @@ return [
...
@@ -172,6 +172,8 @@ return [
'path'
=>
LOG_PATH
,
'path'
=>
LOG_PATH
,
// 日志记录级别
// 日志记录级别
'level'
=>
[],
'level'
=>
[],
// 日志文件权限(设置为 777 让所有用户可写)
'file_permission'
=>
0777
,
],
],
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | Trace设置 开启 app_trace 后 有效
// | Trace设置 开启 app_trace 后 有效
...
...
public/assets/js/backend/shopro/goods/goods.js
View file @
00b514ba
...
@@ -445,6 +445,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
...
@@ -445,6 +445,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
type
:
'normal'
,
// 商品类型
type
:
'normal'
,
// 商品类型
image
:
''
,
image
:
''
,
images
:
[],
images
:
[],
image_3d
:
''
,
title
:
''
,
title
:
''
,
subtitle
:
''
,
subtitle
:
''
,
category_ids
:
''
,
category_ids
:
''
,
...
...
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