* @someone in message of dingding when assign an object.

This commit is contained in:
liugang
2017-10-30 16:01:03 +08:00
parent 09b7b0c0d2
commit fd35539014
+6 -8
View File
@@ -334,25 +334,23 @@ class webhookModel extends model
*/
public function getDingdingData($title, $text, $mobile)
{
if($mobile) $text .= " @{$mobile}";
$markdown = new stdclass();
$markdown->title = $title;
$markdown->text = $text;
$data = new stdclass();
$data->msgtype = 'markdown';
$data->markdown = $markdown;
if($mobile)
{
$at = new stdclass();
$at->atMobiles = array($mobile);
$at->isAtAll = false;
$data->msgtype = 'text';
$data->text = array('content' => $text);
$data->at = $at;
}
else
{
$data->msgtype = 'markdown';
$data->markdown = $markdown;
$data->at = $at;
}
return $data;