Skip to content

Commit

Permalink
增加判断是否有人工客服帐号,避免出现无账号时候,头像为默认头像的情况 (#502)
Browse files Browse the repository at this point in the history
* Update MessageBuilder.php

增加判断是否有人工客服帐号,避免出现无账号时候,头像为默认头像的情况

* Update MessageBuilder.php

样式fix

* 增加判断是否有人工客服帐号,避免出现无账号时候,头像为默认头像的情况
  • Loading branch information
hello2t authored and overtrue committed Sep 12, 2016
1 parent 934aa2d commit 0c5c2a9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Staff/MessageBuilder.php
Expand Up @@ -136,11 +136,15 @@ public function send()
$message = $this->message->get('content');
} else {
$content = $transformer->transform($this->message);

$message = array_merge([
$message = [
'touser' => $this->to,
'customservice' => ['kf_account' => $this->account],
], $content);
];

if ($this->account) {
$message['customservice'] = ['kf_account' => $this->account];
}

$message = array_merge($message, $content);
}

return $this->staff->send($message);
Expand Down

0 comments on commit 0c5c2a9

Please sign in to comment.