mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-27 13:00:23 +08:00
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
|
* @license https://opensource.org/licenses/GPL-2.0
|
|
* @link https://www.koogua.com
|
|
*/
|
|
|
|
namespace App\Services\Logic\Notice\External\WeChat;
|
|
|
|
use App\Repos\WeChatSubscribe as WeChatSubscribeRepo;
|
|
use App\Services\WeChatNotice;
|
|
|
|
class OrderFinish extends WeChatNotice
|
|
{
|
|
|
|
protected $templateCode = 'order_finish';
|
|
|
|
/**
|
|
* @param array $params
|
|
* @return bool|null
|
|
*/
|
|
public function handle($params)
|
|
{
|
|
$subscribeRepo = new WeChatSubscribeRepo();
|
|
|
|
$subscribe = $subscribeRepo->findByUserId($params['user']['id']);
|
|
|
|
if (!$subscribe) return null;
|
|
|
|
$first = '订单已处理完成!';
|
|
$remark = '感谢您的支持,有疑问请联系客服哦!';
|
|
|
|
$params = [
|
|
'first' => $first,
|
|
'remark' => $remark,
|
|
'keyword1' => sprintf('%s元', $params['order']['amount']),
|
|
'keyword2' => $params['order']['subject'],
|
|
'keyword3' => date('Y-m-d H:i', $params['order']['update_time']),
|
|
];
|
|
|
|
$templateId = $this->getTemplateId($this->templateCode);
|
|
|
|
return $this->send($subscribe->open_id, $templateId, $params);
|
|
}
|
|
|
|
}
|