Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ylc.llewan.com
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
llewan
ylc.llewan.com
Commits
b87e0b6f
Commit
b87e0b6f
authored
Sep 21, 2018
by
734642908@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加签到提醒推送
parent
7617ec96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
3 deletions
+81
-3
AuctionController.class.php
Application/Home/Controller/AuctionController.class.php
+1
-1
WechatController.class.php
Application/Home/Controller/WechatController.class.php
+80
-2
No files found.
Application/Home/Controller/AuctionController.class.php
View file @
b87e0b6f
...
...
@@ -292,7 +292,7 @@ class AuctionController extends BaseController
//距离十分钟竞拍活动提醒
if
(
$tempStartTime
<=
(
time
()
+
600
))
{
$wechatObj
=
new
\Home\Controller\WechatController
();
$wechatObj
->
auctionTips
(
$lval
[
'id'
],
$lval
[
'start_time'
]);
$wechatObj
->
auctionTips
(
$lval
[
'id'
],
$lval
[
'
name'
],
$lval
[
'
start_time'
]);
// curlPost(C('domain').'wechat/auctionTips',array('goods_id'=>$lval['id'],'time'=>$lval['start_time']));
}
}
...
...
Application/Home/Controller/WechatController.class.php
View file @
b87e0b6f
...
...
@@ -74,8 +74,86 @@ class WechatController extends BaseController
}
//每日签到提醒
public
function
signTips
()
{
set_time_limit
(
0
);
$signWhere
=
array
(
'game_code'
=>
'ylc'
,
'add_time'
=>
array
(
'gt'
,
strtotime
(
date
(
'Y-m-d'
)))
);
$signArr
=
M
(
"game_member_sign"
,
""
,
C
(
"LEWAN_HEZI"
))
->
where
(
$signWhere
)
->
field
(
'uid'
)
->
select
();
if
(
!
empty
(
$signArr
))
{
$signArr
=
array_column
(
$signArr
,
'uid'
);
}
$sendWhere
=
array
(
'use_way'
=>
'sign_tips'
,
'send_time'
=>
array
(
'gt'
,
date
(
'Y-m-d'
))
);
$sendArr
=
M
(
"yl_template_formid"
,
""
,
C
(
"LEWAN_HEZI"
))
->
where
(
$sendWhere
)
->
field
(
'uid'
)
->
select
();
if
(
!
empty
(
$sendArr
))
{
$sendArr
=
array_column
(
$sendArr
,
'uid'
);
}
$removeArr
=
array_merge
(
$signArr
,
$sendArr
);
$msgWhere
=
array
(
'status'
=>
'1'
,
'send_time'
=>
array
(
'gt'
,
date
(
'Y-m-d'
,
time
()
-
(
60
*
60
*
24
*
6
)))
// ,'uid'=>array('not in',$removeArr)
);
if
(
!
empty
(
$removeArr
))
{
$msgWhere
[
'uid'
]
=
array
(
'not in'
,
$removeArr
);
}
$msgArr
=
M
(
"yl_template_formid"
,
""
,
C
(
"LEWAN_HEZI"
))
->
where
(
$msgWhere
)
->
group
(
'uid'
)
->
order
(
'add_time'
)
->
limit
(
200
)
->
select
();
if
(
!
empty
(
$msgArr
))
{
$token
=
$this
->
getToekn
();
$token
=
json_decode
(
$token
,
true
)[
'access_token'
];
foreach
(
$msgArr
as
$key
=>
$val
)
{
$usergisnArr
=
array
(
'uid'
=>
$val
[
'uid'
]
,
'game_code'
=>
'ylc'
);
$usergisnArr
[
'add_time'
][]
=
array
(
'gt'
,
strtotime
(
date
(
'Y-m-d'
,
time
()
-
(
60
*
60
*
24
))));
$usergisnArr
[
'add_time'
][]
=
array
(
'lt'
,
strtotime
(
date
(
'Y-m-d'
)));
$usergisnInfo
=
M
(
"game_member_sign"
,
""
,
C
(
"LEWAN_HEZI"
))
->
where
(
$usergisnArr
)
->
field
(
'sign_num'
)
->
find
();
$signNum
=
!
empty
(
$usergisnInfo
)
?
$usergisnInfo
[
'sign_num'
]
:
0
;
//发送模板消息
$posturl
=
"https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token="
.
$token
;
$postArr
=
array
(
'touser'
=>
$val
[
'openid'
]
,
'template_id'
=>
'2BMA-KE2gxmSacPVqCw5q9-gapSo737WuDHTZDdlCiU'
,
'page'
=>
'pages/index/index'
,
'form_id'
=>
$val
[
'form_id'
]
,
'data'
=>
array
(
'keyword1'
=>
array
(
'value'
=>
"【签到提醒】签到领玩币,玩币当钱花!!!"
)
,
'keyword2'
=>
array
(
'value'
=>
"你已连续签到
{
$signNum
}
天"
)
,
'keyword3'
=>
array
(
'value'
=>
'从微信顶部[任务栏]-我玩过的/我的小程序,进入可领双倍奖励哦~'
)
)
// ,'emphasis_keyword'=>"keyword1.DATA"
);
$this
->
curlPost
(
$posturl
,
json_encode
(
$postArr
),
true
);
//记录发送数据
$tupdateArr
=
array
(
'status'
=>
2
,
'use_way'
=>
'sign_tips'
,
'send_time'
=>
date
(
'Y-m-d H:i:s'
)
);
M
(
"yl_template_formid"
,
""
,
C
(
"LEWAN_HEZI"
))
->
where
(
array
(
'sysid'
=>
$val
[
'sysid'
]))
->
save
(
$tupdateArr
);
}
echo
'每日签到提醒发送成功'
;
}
else
{
echo
'每日签到提醒发送完毕'
;
}
}
//竞拍活动开始提醒
public
function
auctionTips
(
$goodsId
=
''
,
$time
=
''
)
{
public
function
auctionTips
(
$goodsId
=
''
,
$
name
=
''
,
$
time
=
''
)
{
// $goodsId = I('goods_id');
// $time = I('time');
if
(
empty
(
$goodsId
)
||
empty
(
$time
))
{
...
...
@@ -108,7 +186,7 @@ class WechatController extends BaseController
,
'page'
=>
'pages/index/index'
,
'form_id'
=>
$val
[
'form_id'
]
,
'data'
=>
array
(
'keyword1'
=>
array
(
'value'
=>
'您预约的免费竞拍活动快要开始啦'
)
'keyword1'
=>
array
(
'value'
=>
"您预约的
{
$name
}
免费竞拍活动快要开始啦"
)
,
'keyword2'
=>
array
(
'value'
=>
$time
)
,
'keyword3'
=>
array
(
'value'
=>
'邀请好友可以增加出价次数,出价次数越多,商品越容易竞拍成功哦~'
)
)
...
...
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