Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
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
chenchuanwen
my-yaf-project
Commits
5b608a98
Commit
5b608a98
authored
Oct 15, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pushupdate
parent
c7f3df64
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
Common.php
application/library/Our/Common.php
+13
-0
jpush.php
scripts/crontab/push/jpush.php
+16
-0
No files found.
application/library/Our/Common.php
View file @
5b608a98
...
...
@@ -57,6 +57,19 @@ class Common
return
isset
(
$httpStatusCodes
[
$num
])
?
$httpStatusCodes
[
$num
]
:
''
;
}
public
static
function
isCurentTimeInSection
(
$begin
,
$end
)
{
$checkDayStr
=
date
(
'Y-m-d '
,
time
());
$timeBegin1
=
strtotime
(
$checkDayStr
.
$begin
.
":00"
);
$timeEnd1
=
strtotime
(
$checkDayStr
.
$end
.
":00"
);
$curr_time
=
time
();
if
(
$curr_time
>=
$timeBegin1
&&
$curr_time
<=
$timeEnd1
)
{
return
true
;
}
return
false
;
}
public
static
function
isSerialized
(
$data
)
{
$data
=
trim
(
$data
);
if
(
'N;'
==
$data
)
...
...
scripts/crontab/push/jpush.php
View file @
5b608a98
...
...
@@ -48,10 +48,26 @@ class cliOrderClose extends basecli
$redis
->
auth
(
$conf
[
'password'
]);
}
$clientPush
=
\JPush\ClientPush
::
getInstance
();
$memberCenterServiceDao
=
\Business\User\MemberCenterServiceModel
::
getInstance
();
//$messageService=\DAO\MessageHistoryModel::getInstance();
while
(
$pushData
=
$redis
->
rPop
(
'push_center'
)){
$addData
=
unserialize
(
$pushData
);
$addData
[
'message'
]
=
unserialize
(
$addData
[
'message'
]);
$res
=
$memberCenterServiceDao
->
getMessageSet
(
$addData
[
'toId'
]);
echo
json_encode
(
$res
);
exit
;
if
(
$res
[
'canPush'
]
==
\Our\ApiConst
::
one
){
if
(
!
empty
(
$res
[
'timeDiff'
])){
$timeArr
=
explode
(
'-'
,
$res
[
'timeDiff'
]);
if
(
!
empty
(
$timeArr
)){
if
(
\Our\Common
::
isCurentTimeInSection
(
$timeArr
[
0
],
$timeArr
[
1
])){
continue
;
}
}
}
}
else
{
continue
;
}
$clientPush
->
push
(
$addData
);
}
$redis
->
close
();
...
...
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