Commit f19c7aad authored by hujun's avatar hujun

全局推送处理

parent f85bd85f
......@@ -99,12 +99,17 @@ class PushMessageService
* 成交报告推送(feed流喜报)
*
* @param int $report_id
* @return bool|void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function pushBargainMessage($report_id = 0)
{
if (!$this->pushAllow()) {
return false;
}
$report = new OReportModel();
$feed = new PushFeed();
$agent = new AAgents();
......@@ -153,9 +158,14 @@ class PushMessageService
* @param string $title
* @param string $content
* @param string $url
* @return bool|void
*/
public function pushAll(string $title = '', string $content = '', string $url = '')
{
if (!$this->pushAllow()) {
return false;
}
$url = $this->push->http_host() . '/' . $url;
$this->push->push_message_for_all($title, $content, $url);
return;
......@@ -238,4 +248,15 @@ class PushMessageService
return true;
}
/**
* @return bool
*/
public function pushAllow() {
$url = $this->push->http_host();
if ($url == 'http://api.tonglianjituan.com' || $url == 'https://api.tonglianjituan.com') {
return true;
}
return false;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment