From 152f53ae8d84ba967034b84c1efaffc81a5f1f01 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 13 Nov 2023 10:58:50 +0800 Subject: [PATCH] * Merge 18 code. --- module/job/model.php | 2 +- module/webhook/model.php | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/module/job/model.php b/module/job/model.php index e828427d25..40338a8b5c 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -575,7 +575,7 @@ class jobModel extends model { $pipeline = json_decode($job->pipeline); - $pipelineParams = new stdclass; + $pipelineParams = new stdclass; $pipelineParams->ref = zget($pipeline, 'reference', ''); if(!$pipelineParams->ref) { diff --git a/module/webhook/model.php b/module/webhook/model.php index 2cb94be92f..caf4fbff4b 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -627,11 +627,19 @@ class webhookModel extends model * * @param int $webhookID * @param int $actionID + * @param string $toList * @access public * @return string */ - public function getOpenIdList($webhookID, $actionID) + public function getOpenIdList($webhookID, $actionID, $toList = '') { + if($toList) + { + $openIdList = $this->getBoundUsers($webhookID, $toList); + $openIdList = join(',', $openIdList); + return $openIdList; + } + if(empty($actionID)) return false; $action = $this->dao->select('*')->from(TABLE_ACTION)->where('id')->eq($actionID)->fetch(); @@ -663,10 +671,11 @@ class webhookModel extends model * @param object $webhook * @param string $sendData * @param int $actionID + * @param string $appendUser * @access public * @return int */ - public function fetchHook($webhook, $sendData, $actionID = 0) + public function fetchHook($webhook, $sendData, $actionID = 0, $appendUser = '') { if(!extension_loaded('curl')) return print(helper::jsonEncode($this->lang->webhook->error->curl)); @@ -674,7 +683,7 @@ class webhookModel extends model { if(is_string($webhook->secret)) $webhook->secret = json_decode($webhook->secret); - $openIdList = $this->getOpenIdList($webhook->id, $actionID); + $openIdList = $this->getOpenIdList($webhook->id, $actionID, $appendUser); if(empty($openIdList)) return false; if($webhook->type == 'dinguser') { @@ -790,7 +799,7 @@ class webhookModel extends model $log->url = $webhook->url; $log->contentType = $webhook->contentType; $log->data = $data; - $log->result = $result; + $log->result = (string)$result; $this->dao->insert(TABLE_LOG)->data($log)->exec(); return !dao::isError();