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
e9a00277
Commit
e9a00277
authored
Apr 25, 2026
by
龚双喜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of git.ruanyiit.com:liuxiaomin/loveisland into dev
parents
035f6571
ce4f5d93
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
20 deletions
+108
-20
AiTryon.php
addons/shopro/controller/user/AiTryon.php
+62
-0
User.php
addons/shopro/controller/user/User.php
+1
-17
AiTryon.php
addons/shopro/validate/user/AiTryon.php
+42
-0
AiTryon.php
application/admin/model/shopro/AiTryon.php
+3
-3
No files found.
addons/shopro/controller/user/AiTryon.php
0 → 100644
View file @
e9a00277
<?php
namespace
addons\shopro\controller\user
;
use
addons\shopro\controller\Common
;
use
app\admin\model\shopro\AiTryon
as
AiTryOnModel
;
use
think\Db
;
class
AiTryon
extends
Common
{
protected
$noNeedLogin
=
[];
protected
$noNeedRight
=
[
'*'
];
public
function
_initialize
()
{
parent
::
_initialize
();
// \think\Lang::load(APP_PATH . 'api/lang/zh-cn/user.php'); // 加载语言包
}
/**
* 保存至我的试戴
*/
public
function
saveMyTryon
()
{
if
(
!
$this
->
request
->
isPost
())
{
$this
->
error
(
''
);
}
$user
=
auth_user
();
$params
=
$this
->
request
->
only
([
'url'
,
'goods_id'
,
'goods_title'
,
'goods_sku_id'
,
'goods_sku_name'
,
'goods_sku_image'
]);
$params
[
'user_id'
]
=
$user
->
id
;
$this
->
svalidate
(
$params
,
".add"
);
Db
::
transaction
(
function
()
use
(
$params
)
{
$userAddress
=
new
AiTryOnModel
();
$userAddress
->
save
(
$params
);
});
$this
->
success
(
'保存成功'
);
}
/**
* 我的试戴
*/
public
function
myTryon
()
{
$user
=
auth_user
();
// 查询我的试戴列表
$data
=
AiTryOnModel
::
where
(
'user_id'
,
$user
->
id
)
->
order
(
'id'
,
'desc'
)
->
paginate
(
request
()
->
param
(
'list_rows'
,
10
))
->
toArray
();
$this
->
success
(
'我的试戴'
,
$data
);
}
}
addons/shopro/controller/user/User.php
View file @
e9a00277
...
...
@@ -9,8 +9,8 @@ use app\admin\model\shopro\user\User as UserModel;
use
app\admin\model\shopro\user\Coupon
as
UserCouponModel
;
use
app\admin\model\shopro\order\Order
as
OrderModel
;
use
app\admin\model\shopro\order\Aftersale
as
AftersaleModel
;
use
app\admin\model\shopro\AiTryon
as
AiTryOnModel
;
use
app\admin\model\shopro\ThirdOauth
;
use
think\Db
;
class
User
extends
Common
{
...
...
@@ -48,22 +48,6 @@ class User extends Common
}
/**
* 我的试戴
*/
public
function
myTryon
()
{
$user
=
auth_user
();
// 查询我的试戴列表
$data
=
AiTryOnModel
::
where
(
'user_id'
,
$user
->
id
)
->
order
(
'id'
,
'desc'
)
->
paginate
(
request
()
->
param
(
'list_rows'
,
10
))
->
toArray
();
$this
->
success
(
'我的试戴'
,
$data
);
}
/**
* 第三方授权信息
*/
public
function
thirdOauth
()
...
...
addons/shopro/validate/user/AiTryon.php
0 → 100644
View file @
e9a00277
<?php
namespace
addons\shopro\validate\user
;
use
think\Validate
;
class
AiTryon
extends
Validate
{
/**
* 验证规则
*/
protected
$rule
=
[
'url'
=>
'require|length:0,255'
,
'goods_title'
=>
'require|length:0,255'
,
'goods_sku_name'
=>
'require|length:0,255'
,
'goods_sku_image'
=>
'require|length:0,255'
,
];
/**
* 提示消息
*/
protected
$message
=
[
'url.require'
=>
'AI结果缺失'
,
'url.length'
=>
'AI结果长度必须在 0-255 位'
,
'goods_title.require'
=>
'商品名称缺失'
,
'goods_title.length'
=>
'商品名称长度必须在 0-255 位'
,
'goods_sku_name.require'
=>
'商品型号名称缺失'
,
'goods_sku_name.length'
=>
'商品型号名称长度必须在 0-255 位'
,
'goods_sku_image.require'
=>
'商品型号图片缺失'
,
'goods_sku_image.length'
=>
'商品型号图片长度必须在 0-255 位'
];
/**
* 验证场景
*/
protected
$scene
=
[
'add'
=>
[
'url'
,
'goods_id'
,
'goods_title'
,
'goods_sku_id'
,
'goods_sku_name'
,
'goods_sku_image'
],
'edit'
=>
[],
];
}
application/admin/model/shopro/AiTryon.php
View file @
e9a00277
...
...
@@ -24,12 +24,12 @@ class AiTryon extends Model
'url'
,
'user_id'
,
'goods_id'
,
'goods_sku_id'
,
'goods_title'
,
'goods_image'
,
'goods_sku_id'
,
'goods_sku_image'
,
'goods_sku_name'
];
...
...
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