BusinessShopNotice.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Name: 芸众商城系统
  5. * Author: 广州市芸众信息科技有限公司
  6. * Profile: 广州市芸众信息科技有限公司位于国际商贸中心的广州,专注于移动电子商务生态系统打造,拥有芸众社交电商系统、区块链数字资产管理系统、供应链管理系统、电子合同等产品/服务。官网 :www.yunzmall.com www.yunzshop.com
  7. * Date: 2022/8/8
  8. * Time: 10:01
  9. */
  10. namespace business\common\notice;
  11. use business\common\models\MessageNotice;
  12. class BusinessShopNotice extends BusinessMessageNoticeBase
  13. {
  14. public function getPluginName()
  15. {
  16. return '商城基础';
  17. }
  18. public function getPlugin()
  19. {
  20. return 'shop';
  21. }
  22. public function create($data = [])
  23. {
  24. $this->saveNotice($data['user_ids'], $data['param'], $data['html']);
  25. }
  26. public function showBody()
  27. {
  28. $notice= $this->getMessageNotice();
  29. $body = [
  30. 'head' => $notice->param['head'],
  31. 'title' =>$notice->param['title'],
  32. 'content' => $notice->html?:'',
  33. 'notice_time'=> $notice->created_at ? $notice->created_at->format('Y-m-d H:i:s'): date('Y-m-d H:i:s', time()),
  34. ];
  35. return $body;
  36. }
  37. public function webSocketMessage(MessageNotice $notice)
  38. {
  39. $msg['jump_url'] = yzBusinessFullUrl('login');
  40. $msg['creator_name'] = $notice->getSendStaff()->name;
  41. $msg['notice_time'] = $notice->created_at ? $notice->created_at->format('Y-m-d H:i:s'): date('Y-m-d H:i:s', time());
  42. $msg['content'] = $notice['html'];
  43. $msg['type'] = 'shop';
  44. $msg['code'] = $this->getPlugin();
  45. return $msg;
  46. }
  47. public function getAllType()
  48. {
  49. return [];
  50. }
  51. }