1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-06 08:51:10 +08:00
2020-12-20 17:28:13 +08:00

38 lines
784 B
PHP

<?php
namespace App\Services\Sms\Notice;
use App\Models\User as UserModel;
use App\Repos\Account as AccountRepo;
use App\Services\Smser;
class ConsultReply extends Smser
{
protected $templateCode = 'consult_reply';
/**
* @param UserModel $user
* @param array $params
* @return bool|null
*/
public function handle(UserModel $user, array $params)
{
$accountRepo = new AccountRepo();
$account = $accountRepo->findById($user->id);
if (!$account->phone) return null;
$templateId = $this->getTemplateId($this->templateCode);
$params = [
$params['replier']['name'],
$params['course']['title'],
];
return $this->send($account->phone, $templateId, $params);
}
}