@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | ], |
8 | 8 | 'components' => [ |
9 | 9 | 'cache' => [ |
10 | - 'keyPrefix' => 'web', //前缀 |
|
10 | + 'keyPrefix' => 'web', //前缀 |
|
11 | 11 | ], |
12 | 12 | 'authManager' => [ |
13 | 13 | 'class' => yuncms\rbac\DbManager::class, |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | 'secureProtocolHeaders' => [ |
30 | 30 | 'X-Forwarded-Proto' => ['https'], // Common |
31 | 31 | 'Front-End-Https' => ['on'], // Microsoft |
32 | - 'X-Client-Scheme' => ['https'],// Aliyun CDN |
|
32 | + 'X-Client-Scheme' => ['https'], // Aliyun CDN |
|
33 | 33 | 'X-Client-Proto' => ['https'], |
34 | 34 | ], |
35 | 35 | 'ipHeaders' => [ |
36 | - 'X-Forwarded-For',// Common |
|
36 | + 'X-Forwarded-For', // Common |
|
37 | 37 | 'X-Cluster-Client-IP', |
38 | - 'ALI-CDN-REAL-IP',// Aliyun CDN |
|
38 | + 'ALI-CDN-REAL-IP', // Aliyun CDN |
|
39 | 39 | 'Client-IP', |
40 | 40 | 'X-Forwarded', |
41 | 41 | 'Forwarded-For', |
@@ -70,7 +70,7 @@ |
||
70 | 70 | */ |
71 | 71 | public function actionUnreadNotifications() |
72 | 72 | { |
73 | - $total = Notification::getDb()->cache(function ($db) { |
|
73 | + $total = Notification::getDb()->cache(function($db) { |
|
74 | 74 | return Notification::find()->where(['receiver_id' => Yii::$app->user->id, 'is_read' => false])->count(); |
75 | 75 | }, 60); |
76 | 76 | return ['total' => $total]; |
@@ -24,19 +24,19 @@ |
||
24 | 24 | } |
25 | 25 | // https://segmentfault.com/q/1010000000672529/a-1020000000679702 |
26 | 26 | $this->createTable($this->tableName, [ |
27 | - 'id' => $this->bigPrimaryKey()->unsigned()->comment('Id'),//通知ID |
|
28 | - 'verb' => $this->string(32)->comment('Verb'),//活动图片 |
|
29 | - 'template' => $this->string()->comment('Template'),//通知类型 |
|
30 | - 'channel' => $this->string(64)->comment('Template'),//通知类型 |
|
31 | - 'is_read' => $this->boolean()->defaultValue(false)->comment('Read'),//是否已读 |
|
32 | - 'is_pending' => $this->boolean()->defaultValue(false)->comment('Pending'),//是否已经推送 |
|
33 | - 'sender_id' => $this->integer()->unsigned()->comment('Sender Id'),//发送者ID |
|
34 | - 'sender_class' => $this->string()->comment('Sender Class'),//发送者模型 |
|
35 | - 'receiver_id' => $this->unsignedInteger()->comment('Receiver Id'),//接收器 |
|
36 | - 'entity_id' => $this->unsignedInteger()->comment('Entity'),//任务对象 |
|
37 | - 'source_id' => $this->unsignedInteger()->comment('Source'),//原有任务对象 |
|
38 | - 'target_id' => $this->unsignedInteger()->comment('Target'),//目标对象 |
|
39 | - 'publish_at' => $this->integer()->unsigned()->notNull()->comment('Publish At'),//发送时间 |
|
27 | + 'id' => $this->bigPrimaryKey()->unsigned()->comment('Id'), //通知ID |
|
28 | + 'verb' => $this->string(32)->comment('Verb'), //活动图片 |
|
29 | + 'template' => $this->string()->comment('Template'), //通知类型 |
|
30 | + 'channel' => $this->string(64)->comment('Template'), //通知类型 |
|
31 | + 'is_read' => $this->boolean()->defaultValue(false)->comment('Read'), //是否已读 |
|
32 | + 'is_pending' => $this->boolean()->defaultValue(false)->comment('Pending'), //是否已经推送 |
|
33 | + 'sender_id' => $this->integer()->unsigned()->comment('Sender Id'), //发送者ID |
|
34 | + 'sender_class' => $this->string()->comment('Sender Class'), //发送者模型 |
|
35 | + 'receiver_id' => $this->unsignedInteger()->comment('Receiver Id'), //接收器 |
|
36 | + 'entity_id' => $this->unsignedInteger()->comment('Entity'), //任务对象 |
|
37 | + 'source_id' => $this->unsignedInteger()->comment('Source'), //原有任务对象 |
|
38 | + 'target_id' => $this->unsignedInteger()->comment('Target'), //目标对象 |
|
39 | + 'publish_at' => $this->integer()->unsigned()->notNull()->comment('Publish At'), //发送时间 |
|
40 | 40 | ], $tableOptions); |
41 | 41 | |
42 | 42 | $this->createIndex('notification_index', $this->tableName, ['sender_id', 'sender_class']); |