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
c1b27da1
Commit
c1b27da1
authored
Oct 15, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into ccw
parents
cebb1463
f7fa4a34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
+18
-15
Message.php
application/controllers/Message.php
+5
-3
jpush.php
scripts/crontab/push/jpush.php
+13
-12
No files found.
application/controllers/Message.php
View file @
c1b27da1
...
...
@@ -153,9 +153,11 @@ class MessageController extends \Our\Controller_AbstractApi {
}
public
function
setAction
(){
$messageService
=
\Business\Message\MessageServiceModel
::
getInstance
();
$pushSet
[
'canPush'
]
=
$this
->
req
[
'data'
][
'canPush'
];
$pushSet
[
'sound'
]
=
$this
->
req
[
'data'
][
'sound'
];
$pushSet
[
'vibrate'
]
=
$this
->
req
[
'data'
][
'vibrate'
];
$memberCenterService
=
\Business\User\MemberCenterServiceModel
::
getInstance
();
$messageSet
=
$memberCenterService
->
getMessageSet
(
$this
->
memberId
);
$pushSet
[
'canPush'
]
=!
empty
(
$this
->
req
[
'data'
][
'canPush'
])
?
$this
->
req
[
'data'
][
'canPush'
]
:
$messageSet
[
'canPush'
];
$pushSet
[
'sound'
]
=!
empty
(
$this
->
req
[
'data'
][
'sound'
])
?
$this
->
req
[
'data'
][
'sound'
]
:
$messageSet
[
'sound'
];
$pushSet
[
'vibrate'
]
=!
empty
(
$this
->
req
[
'data'
][
'vibrate'
])
?
$this
->
req
[
'data'
][
'vibrate'
]
:
$messageSet
[
'vibrate'
];
$pushSet
[
'timeDiff'
]
=
$this
->
req
[
'data'
][
'timeDiff'
];
if
(
isset
(
$pushSet
[
'canPush'
])
&&
isset
(
$pushSet
[
'sound'
])
&&
isset
(
$pushSet
[
'vibrate'
])
){
$res
=
$messageService
->
set
(
$this
->
memberId
,
$pushSet
);
...
...
scripts/crontab/push/jpush.php
View file @
c1b27da1
...
...
@@ -48,25 +48,26 @@ class cliOrderClose extends basecli
$redis
->
auth
(
$conf
[
'password'
]);
}
$clientPush
=
\JPush\ClientPush
::
getInstance
();
$memberCenterServiceDao
=
\Business\User\MemberCenterServiceModel
::
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'
]);
if
(
$res
[
'canPush'
]
=
=
\Our\ApiConst
::
one
){
if
(
$res
[
'canPush'
]
!
=
\Our\ApiConst
::
one
){
continue
;
}
else
{
if
(
!
empty
(
$res
[
'timeDiff'
])){
$timeArr
=
explode
(
'-'
,
$res
[
'timeDiff'
]);
if
(
!
empty
(
$timeArr
)){
if
(
\Our\Common
::
isCurentTimeInSection
(
$timeArr
[
0
],
$timeArr
[
1
])){
continue
;
}
}
}
}
// else{
// if(!empty($res['timeDiff'])){
// $timeArr=explode('-',$res['timeDiff']);
// if(!empty($timeArr)){
// if(\Our\Common::isCurentTimeInSection($timeArr[0],$timeArr[1])){
// 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