Commit a92c8f61 authored by christ's avatar christ

master

parent 5d4a4142
...@@ -445,7 +445,7 @@ class MessageServiceModel extends \Business\AbstractModel ...@@ -445,7 +445,7 @@ class MessageServiceModel extends \Business\AbstractModel
} }
} }
public function addMessageCenterToDb() public function addMessageCenterToDb($pushPushCenter=true)
{ {
$conf = \Yaf\Registry::get('config')->get('redis.database.params'); $conf = \Yaf\Registry::get('config')->get('redis.database.params');
$this->baseRedis = new \Redis(); $this->baseRedis = new \Redis();
...@@ -454,7 +454,9 @@ class MessageServiceModel extends \Business\AbstractModel ...@@ -454,7 +454,9 @@ class MessageServiceModel extends \Business\AbstractModel
$this->baseRedis->auth($conf['password']); $this->baseRedis->auth($conf['password']);
} }
while ($center = $this->baseRedis->lPop('message_center')) { while ($center = $this->baseRedis->lPop('message_center')) {
$this->baseRedis->rPush('push_center', $center); if($pushPushCenter){
$this->baseRedis->rPush('push_center', $center);
}
$addData = unserialize($center); $addData = unserialize($center);
$addData['message'] = unserialize($addData['message']); $addData['message'] = unserialize($addData['message']);
$this->addMessage($addData['fromId'], $addData['fromUserId'], $addData['fromUserName'], $addData['fromType'], $addData['message'], $addData['toId'], $addData['toUserId'], $addData['toUserName'], $addData['toType'], $addData['id']); $this->addMessage($addData['fromId'], $addData['fromUserId'], $addData['fromUserName'], $addData['fromType'], $addData['message'], $addData['toId'], $addData['toUserId'], $addData['toUserName'], $addData['toType'], $addData['id']);
......
...@@ -276,6 +276,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -276,6 +276,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
'orderId'=>$order['order_id'])); 'orderId'=>$order['order_id']));
$push->addOneToClient($pushData); $push->addOneToClient($pushData);
$push->sendTcpMessage(); $push->sendTcpMessage();
$messageService=\Business\Message\MessageServiceModel::getInstance();
$messageService->addMessageCenterToDb(false);
// $push->addOneToClient(); // $push->addOneToClient();
// \Our\RedisHelper::rpush('client_push',array('storeId'=>$order['storeId'],'type'=>ApiConst::messageWaitReceive,'op'=>NameConst::reduce,'num'=>ApiConst::one,'params'=>array('c'=>'shopkeeper','m'=>'orderDetail','orderId'=>$order['orderId']))); // \Our\RedisHelper::rpush('client_push',array('storeId'=>$order['storeId'],'type'=>ApiConst::messageWaitReceive,'op'=>NameConst::reduce,'num'=>ApiConst::one,'params'=>array('c'=>'shopkeeper','m'=>'orderDetail','orderId'=>$order['orderId'])));
//\Our\RedisHelper::rpush('client_push',array('storeId'=>$order['storeId'],'type'=>$type,'op'=>NameConst::add,'num'=>ApiConst::one,'params'=>array('c'=>'shopkeeper','m'=>'orderDetail','orderId'=>$order['orderId']))); //\Our\RedisHelper::rpush('client_push',array('storeId'=>$order['storeId'],'type'=>$type,'op'=>NameConst::add,'num'=>ApiConst::one,'params'=>array('c'=>'shopkeeper','m'=>'orderDetail','orderId'=>$order['orderId'])));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment