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
b9318068
Commit
b9318068
authored
Dec 01, 2018
by
christ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户订单被接单推送
parent
2cafe60e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
2 deletions
+20
-2
ApiConst.php
application/library/Our/ApiConst.php
+1
-0
Push.php
application/library/Our/Push.php
+18
-0
OrderService.php
application/models/Business/Order/OrderService.php
+0
-2
ShopkeeperService.php
application/models/Business/Store/ShopkeeperService.php
+1
-0
No files found.
application/library/Our/ApiConst.php
View file @
b9318068
...
...
@@ -421,6 +421,7 @@ class ApiConst
const
reachRemindMessageType
=
1
;
const
waitRecieveOrderType
=
15
;
const
deliveryOrderType
=
16
;
const
reicieveOrderType
=
17
;
//pcClient 消息推送消息模板类型常量
const
messageWaitReceive
=
101
;
//售后
...
...
application/library/Our/Push.php
View file @
b9318068
...
...
@@ -234,6 +234,24 @@ class Push
return
$messageContent
;
}
//用户被接单消息
public
function
RecievedOrder
(
$storeId
,
$orderId
,
$orderSn
)
{
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$condition
[
'store_id'
]
=
$storeId
;
$store
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db6\StoreRedisModel
::
getInstance
(),
array
(
&
$storeDao
,
'getInfo'
),
array
(
$condition
),
ApiConst
::
oneDaySecond
,
array
(
$storeId
));
//$store = $storeDao->getInfo(array('store_id'=>$storeId));
$orderService
=
\Business\Order\OrderServiceModel
::
getInstance
();
$orderDetail
=
$orderService
->
getOrderDetail
(
$orderId
);
$toUserId
=
$storeId
;
$messageContent
=
$this
->
getOrderMessageContent
(
$orderDetail
);
$fromAvatar
=
Common
::
getStaticFile
(
ImageConst
::
orderAvatarName
,
ImageConst
::
systemAvatar
);
$href
=
Common
::
format
(
PathConst
::
orderId
,
$orderId
);
$buttons
=
$this
->
getComfirmRecieveButtons
(
$orderId
);
$message
=
$this
->
getMessageTemplate
(
ApiConst
::
reicieveOrderType
,
DescribeConst
::
recieveWaitTitle
,
$messageContent
,
''
,
''
,
$href
,
ApiConst
::
zero
,
$buttons
);
$id
=
time
()
.
(
string
)
$this
->
orderIdStr
.
$orderId
;
$this
->
pushMessage
(
$id
,
$this
->
orderId
,
$orderDetail
[
'buyerId'
],
$this
->
orderId
,
$toUserId
,
$this
->
orderName
,
$store
[
'store_name'
],
ApiConst
::
orderMessageType
,
ApiConst
::
storeMessageType
,
$fromAvatar
,
$message
);
}
//店铺接单
public
function
recieveWait
(
$storeId
,
$orderId
,
$orderSn
)
{
...
...
application/models/Business/Order/OrderService.php
View file @
b9318068
...
...
@@ -493,7 +493,6 @@ class OrderServiceModel extends \Business\AbstractModel
public
function
pushRecieveOrder
(
$order
){
$push
=
Push
::
getInstance
();
$push
->
recieveWait
(
$order
[
'storeId'
],
$order
[
'orderId'
],
$order
[
'orderSn'
]);
$push
=
\Our\Push
::
getInstance
();
$pushData
=
array
(
'storeId'
=>
$order
[
'storeId'
],
'type'
=>
ApiConst
::
messageWaitReceive
,
'waitReceiveCount'
=>
ApiConst
::
one
,
...
...
@@ -508,7 +507,6 @@ class OrderServiceModel extends \Business\AbstractModel
'm'
=>
'orderDetail'
,
'orderId'
=>
$order
[
'orderId'
]));
$push
->
addOneToClient
(
$pushData
);
$push
->
sendTcpMessage
();
// \Our\RedisHelper::rpush('client_push',array('storeId'=>$order['storeId'],'type'=>ApiConst::messageWaitReceive,'op'=>NameConst::add,'num'=>ApiConst::one,'params'=>array('c'=>'shopkeeper','m'=>'orderDetail','orderId'=>$order['orderId'])));
$push
->
sendTcpMessage
();
$messageService
=
\Business\Message\MessageServiceModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
...
...
application/models/Business/Store/ShopkeeperService.php
View file @
b9318068
...
...
@@ -260,6 +260,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$type
=
ApiConst
::
messageWaitSend
;
}
$push
=
\Our\Push
::
getInstance
();
$push
->
RecievedOrder
(
$order
[
'store_id'
],
$order
[
'order_id'
],
$order
[
'orderSn'
]);
$pushData
=
array
(
'storeId'
=>
$order
[
'store_id'
],
'type'
=>
ApiConst
::
messageWaitReceive
,
'waitReceiveCount'
=>
ApiConst
::
reduceOne
,
...
...
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