Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-activity-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
7 years ago
Commit
407715e38c2d52542b165c03e435b74f488e917d
1 parent
8ca92ffc
send message
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
15 deletions
apps/activity/models/zero-buy.js
apps/admin/models/activity.js
apps/activity/models/zero-buy.js
View file @
407715e
...
...
@@ -458,9 +458,9 @@ module.exports = class extends global.yoho.BaseModel {
* @returns {*}
*/
sendWechatMessage
(
uid
,
actPrizeId
,
extra
=
{})
{
return
this
.
post
({
url
:
'/yoho-message-controller/MessageRest/sendMessage'
,
return
this
.
get
({
data
:
{
method
:
'wechat.message.send'
,
sendScene
:
'MINI_ACTIVITY_JOIN'
,
params
:
JSON
.
stringify
({
activityTitle
:
extra
.
actName
,
...
...
apps/admin/models/activity.js
View file @
407715e
...
...
@@ -756,22 +756,28 @@ class AdminModel extends global.yoho.BaseModel {
userList
=
_
.
compact
(
_
.
uniq
(
userList
));
if
(
!
userList
.
length
)
{
return
Promise
.
resolve
();
}
let
msgApi
=
[];
let
msgData
=
{
method
:
'wechat.message.send'
,
sendScene
:
'MINI_WINNING_NOTICE'
,
params
:
JSON
.
stringify
({
activityTitle
:
productInfo
.
name
,
activityTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm'
)
+
':00'
,
pageUrl
:
'/page/subPackage/pages/zeroSell/detail?actPrizeId='
+
id
})
};
return
this
.
post
({
url
:
'/yoho-message-controller/MessageRest/sendMessage'
,
data
:
{
sendScene
:
'MINI_WINNING_NOTICE'
,
params
:
JSON
.
stringify
({
activityTitle
:
productInfo
.
name
,
activityTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm'
)
+
':00'
,
pageUrl
:
'/page/subPackage/pages/zeroSell/detail?actPrizeId='
+
id
}),
uidList
:
userList
_
.
forEach
(
_
.
chunk
(
userList
,
400
),
value
=>
{
if
(
value
&&
value
.
length
)
{
msgApi
.
push
(
this
.
get
({
data
:
Object
.
assign
({
uidList
:
value
},
msgData
)}));
}
});
if
(
!
msgApi
.
length
)
{
return
Promise
.
resolve
();
}
return
Promise
.
all
(
msgApi
);
}
}
...
...
Please
register
or
login
to post a comment