MailApi.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2017/12/1/001
  6. * Time: 15:30
  7. */
  8. namespace backend\models;
  9. class MailApi extends BaseApi
  10. {
  11. public $apiUrl = 'mail';
  12. public function getMailList($data = [])
  13. {
  14. $result = $this->get($this->apiUrl.'/get-mail-list', $data);
  15. if ($result['code'] == 1) {
  16. return $this->returnArray(1, $result['data'], '获取列表成功');
  17. } else {
  18. return $this->returnArray(0, [], $result['message']);
  19. }
  20. }
  21. public function getMailRecordList($data = [])
  22. {
  23. $result = $this->get($this->apiUrl.'/get-mail-record-list', $data);
  24. if ($result['code'] == 1) {
  25. return $this->returnArray(1, $result['data'], '获取列表成功');
  26. } else {
  27. return $this->returnArray(0, [], $result['message']);
  28. }
  29. }
  30. public function viewMail($data = [])
  31. {
  32. $result = $this->get($this->apiUrl.'/view-mail', $data);
  33. if ($result['code'] == 1) {
  34. return $this->returnArray(1, $result['data'], '获取邮件详情成功');
  35. } else {
  36. return $this->returnArray(0, [], '获取邮件详情失败');
  37. }
  38. }
  39. public function viewMailRecord($data = [])
  40. {
  41. $result = $this->get($this->apiUrl.'/view-mail-record', $data);
  42. if ($result['code'] == 1) {
  43. return $this->returnArray(1, $result['data'], '获取邮件详情成功');
  44. } else {
  45. return $this->returnArray(0, [], '获取邮件详情失败');
  46. }
  47. }
  48. public function saveMail($data = [])
  49. {
  50. $result = $this->post($this->apiUrl.'/save-mail', $data);
  51. if ($result['code'] == 1) {
  52. return $this->returnArray(1, $result['data'], '新增成功');
  53. } else {
  54. return $this->returnArray(0, [], '新增失败');
  55. }
  56. }
  57. public function delMail($data = [])
  58. {
  59. $result = $this->post($this->apiUrl.'/del-mail', $data);
  60. if ($result['code'] == 1) {
  61. return $this->returnArray(1, $result['data'], '删除成功');
  62. } else {
  63. return $this->returnArray(0, [], '删除失败');
  64. }
  65. }
  66. public function sendMail($data = [])
  67. {
  68. $result = $this->post($this->apiUrl.'/send-mail', $data);
  69. if ($result['code'] == 1) {
  70. return $this->returnArray(1, $result['data'], '发送成功');
  71. } else {
  72. return $this->returnArray(0, [], '发送失败');
  73. }
  74. }
  75. public function sendMailRecord($data = [])
  76. {
  77. $result = $this->post($this->apiUrl.'/send-mail-record', $data);
  78. if ($result['code'] == 1) {
  79. return $this->returnArray(1, $result['data'], '发送成功');
  80. } else {
  81. return $this->returnArray(0, [], '发送失败');
  82. }
  83. }
  84. public function delMailRecord($data = [])
  85. {
  86. $result = $this->post($this->apiUrl.'/del-mail-record', $data);
  87. if ($result['code'] == 1) {
  88. return $this->returnArray(1, $result['data'], '删除成功');
  89. } else {
  90. return $this->returnArray(0, [], '删除失败');
  91. }
  92. }
  93. public function Statistics($data = [])
  94. {
  95. $result = $this->post($this->apiUrl.'/statistics', $data);
  96. if ($result['code'] == 1) {
  97. return $this->returnArray(1, $result['data'], '查找成功');
  98. } else {
  99. return $this->returnArray(0, [], '查找失败');
  100. }
  101. }
  102. }