Index.php 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace addons\alisms\controller;
  3. use think\addons\Controller;
  4. /**
  5. * 二维码生成
  6. *
  7. */
  8. class Index extends Controller
  9. {
  10. protected $model = null;
  11. public function _initialize()
  12. {
  13. parent::_initialize();
  14. }
  15. //
  16. public function index()
  17. {
  18. return $this->view->fetch();
  19. }
  20. public function send()
  21. {
  22. $mobile = $this->request->post('mobile');
  23. $template = $this->request->post('template');
  24. $sign = $this->request->post('sign');
  25. $param = (array) json_decode($this->request->post('param'));
  26. $alisms = new \addons\alisms\library\Alisms();
  27. $ret = $alisms->mobile($mobile)
  28. ->template($template)
  29. ->sign($sign)
  30. ->param($param)
  31. ->send();
  32. if ($ret)
  33. {
  34. $this->success("发送成功");
  35. }
  36. else
  37. {
  38. $this->error("发送失败!失败原因:" . $alisms->getError());
  39. }
  40. }
  41. }