data = $content['data']; parent::__construct(); $this->template_id = $content['template']; $this->mall_sms = $content['mall_sms']; } // 定义使用模板发送方式平台所需要的模板 ID public function getTemplate(GatewayInterface $gateway = null) { return $this->template_id; } // 模板参数 public function getData(GatewayInterface $gateway = null) { $data = []; foreach ($this->data as $key => $value) { $data[$key] = $value; } if ($this->mall_sms == 'submail') { $data['project'] = $this->template_id; } return $data; } }