Notify.php 737 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace common\widgets\notify;
  3. use Yii;
  4. use yii\base\Widget;
  5. /**
  6. * Class Notify
  7. * @package common\widgets\notify
  8. * @author jianyan74 <751393839@qq.com>
  9. */
  10. class Notify extends Widget
  11. {
  12. /**
  13. * @return string
  14. * @throws \yii\db\Exception
  15. */
  16. public function run()
  17. {
  18. // 拉取公告
  19. Yii::$app->services->notify->pullAnnounce(Yii::$app->user->identity->merchant_id, Yii::$app->user->identity->created_at);
  20. // 获取当前通知
  21. list($notify, $count) = Yii::$app->services->notifyMember->getNotReadNotify(Yii::$app->user->identity->merchant_id);
  22. return $this->render('notify', [
  23. 'notify' => $notify,
  24. 'count' => $count,
  25. ]);
  26. }
  27. }
粤ICP备19079148号