johnnylei / message_system Goto Github PK
View Code? Open in Web Editor NEW这是一个基于yii2的消息系统,
这是一个基于yii2的消息系统,
这是我的 components configure
'messageManager'=>[
'class'=>'johnnylei\message_system\MessageManager',
// userInformation 是一个用户表的activeRecord,主要作用当你发送消息的时候,将用户表里面的消息总数+1,当你阅读完消息的时候,将用户表里面的消息数-1,
// 通过实现UserInformationInterface,里面的两个方法
'userInformation'=>[
'class'=>'common\models\User',
]
],
是还要在用户表添加消息数的字段么 ?字段名是什么?麻烦帮助一下,谢谢
$subscription->subscription($userId, $queueId); 说明里的 user 和 queque位置反了。
例子里面的send的用法
Yii::$app->messageManager->send([
'title'=> 'this is title',
'body'=> 'this is body',
'type'=>'this is message type',
'show_style'=>'this is show style',
], $queue_id);
是不是应该写成
$sender = new messageManager;
$sender->send([
'title'=> 'this is title',
'body'=> 'this is body',
'type'=>'system',
//'show_style'=>'',
'queue_id' => $queue_id
], $queue_id);
而且第二个参数queue是干什么用的,貌似没用上?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.