Notice.php 708 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: shenyang
  5. * Date: 2017/6/12
  6. * Time: 下午5:51
  7. */
  8. namespace app\common\services\wechat;
  9. use app\common\facades\Setting;
  10. class Notice extends \EasyWeChat\Notice\Notice
  11. {
  12. public function send($data = [])
  13. {
  14. if(Setting::get('shop.notice.toggle') == false){
  15. return false;
  16. }
  17. return parent::send();
  18. }
  19. protected function checkAndThrow(array $contents)
  20. {
  21. if (isset($contents['errcode']) && 0 !== $contents['errcode']) {
  22. if (empty($contents['errmsg'])) {
  23. $contents['errmsg'] = 'Unknown';
  24. }
  25. \Log::error('消息推送出错', $contents);
  26. }
  27. }
  28. }