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
5aaa7230
Commit
5aaa7230
authored
May 12, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AI试戴接口优化;活动详情增加出参;
parent
ea8bb346
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
1 deletion
+37
-1
Activity.php
addons/shopro/controller/activity/Activity.php
+7
-0
AiTryon.php
addons/shopro/controller/user/AiTryon.php
+1
-1
Activity.php
application/admin/model/shopro/activity/Activity.php
+29
-0
No files found.
addons/shopro/controller/activity/Activity.php
View file @
5aaa7230
...
@@ -33,6 +33,13 @@ class Activity extends Common
...
@@ -33,6 +33,13 @@ class Activity extends Common
$activity
[
'texts'
]
=
$texts
;
$activity
[
'texts'
]
=
$texts
;
}
}
// 活动类型是拼团活动,增加拼团买家信息
if
(
$activity
[
'type'
]
==
'groupon'
)
{
$activityMod
=
new
ActivityModel
();
$activity
[
'person_groupon_users'
]
=
$activityMod
->
getTopGrouponUsers
(
$id
);
$activity
[
'total_proupon_users'
]
=
$activityMod
->
getGrouponTotal
(
$id
);
}
$this
->
success
(
'获取成功'
,
$activity
);
$this
->
success
(
'获取成功'
,
$activity
);
}
}
}
}
addons/shopro/controller/user/AiTryon.php
View file @
5aaa7230
...
@@ -126,7 +126,7 @@ class AiTryon extends Common
...
@@ -126,7 +126,7 @@ class AiTryon extends Common
// 合成AI图
// 合成AI图
$ai
=
new
Ai
();
$ai
=
new
Ai
();
$res
=
$ai
->
generateImage
(
$params
,
$user
->
id
);
$res
=
$ai
->
generateImage
(
$params
,
$user
->
id
,
'b64_json'
);
// 我的试戴
// 我的试戴
$tryonModel
=
new
AiTryOnModel
();
$tryonModel
=
new
AiTryOnModel
();
...
...
application/admin/model/shopro/activity/Activity.php
View file @
5aaa7230
...
@@ -8,6 +8,7 @@ use app\admin\model\shopro\goods\Goods;
...
@@ -8,6 +8,7 @@ use app\admin\model\shopro\goods\Goods;
use
addons\shopro\facade\Activity
as
ActivityFacade
;
use
addons\shopro\facade\Activity
as
ActivityFacade
;
use
app\admin\model\shopro\goods\SkuPrice
as
SkuPriceModel
;
use
app\admin\model\shopro\goods\SkuPrice
as
SkuPriceModel
;
use
app\admin\model\shopro\activity\SkuPrice
as
ActivitySkuPriceModel
;
use
app\admin\model\shopro\activity\SkuPrice
as
ActivitySkuPriceModel
;
use
app\admin\model\shopro\activity\GrouponLog
;
class
Activity
extends
Common
class
Activity
extends
Common
{
{
...
@@ -418,4 +419,32 @@ class Activity extends Common
...
@@ -418,4 +419,32 @@ class Activity extends Common
{
{
return
$this
->
hasMany
(
SkuPrice
::
class
,
'activity_id'
);
return
$this
->
hasMany
(
SkuPrice
::
class
,
'activity_id'
);
}
}
/**
* 获取参与活动的总人数
*/
public
function
getGrouponTotal
(
$id
)
{
$total
=
GrouponLog
::
where
(
'activity_id'
,
$id
)
->
group
(
'user_id'
)
->
count
();
return
$total
?:
0
;
}
/**
* 获取参与活动的前3个用户(用户ID和用户头像)
*/
public
function
getTopGrouponUsers
(
$id
)
{
$topUsers
=
GrouponLog
::
where
(
'activity_id'
,
$id
)
->
field
(
'user_id, ANY_VALUE(nickname) nickname, ANY_VALUE(avatar) avatar'
)
->
group
(
'user_id'
)
->
orderRaw
(
'MIN(createtime) asc'
)
->
limit
(
3
)
->
select
();
return
$topUsers
?
$topUsers
:
[];
}
}
}
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