template_id = $temp_id; $this->openid = $openid; $this->data = $data; $this->openids = $openids; $this->uniacid = \YunShop::app()->uniacid; $this->url = $url; $this->type = $type; if (app('plugins')->isEnabled('min-app')) { $res = \Setting::get('plugin.min_app'); $this->options['app_id'] = empty($res['key']) ? '' : $res['key']; $this->options['secret'] = empty($res['secret']) ? '' : $res['secret']; } } protected function notice($openid) { if ($this->type == 1 && \Setting::get('shop.notice.toggle') == false) { $back['status'] = 0; $back['message'] = "后台消息通知未开启"; return $back; } if ($this->type == 1) { \Log::debug("新版公众号消息-4",$this->template_id); \Log::debug("新版公众号消息-5",$openid); \Log::debug("新版公众号消息-6",$this->data); $job = new MessageNoticeJob($this->template_id, $this->data, $openid, $this->url); DispatchesJobs::dispatch($job,DispatchesJobs::LOW); } if ($this->type == 2) { \Log::debug("新版小程序消息-4",$this->template_id); \Log::debug("新版小程序消息-5",$openid); \Log::debug("新版小程序消息-6",$this->data); $job = new MiniMessageNoticeJob($this->options, $this->template_id, $this->data,$openid, $this->url); DispatchesJobs::dispatch($job,DispatchesJobs::LOW); } $back['status'] = 1; $back['message'] = ""; return $back; } }