| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2017/12/1/001
- * Time: 15:30
- */
- namespace backend\models;
- class MailApi extends BaseApi
- {
- public $apiUrl = 'mail';
-
- public function getMailList($data = [])
- {
- $result = $this->get($this->apiUrl.'/get-mail-list', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '获取列表成功');
- } else {
- return $this->returnArray(0, [], $result['message']);
- }
- }
-
- public function getMailRecordList($data = [])
- {
- $result = $this->get($this->apiUrl.'/get-mail-record-list', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '获取列表成功');
- } else {
- return $this->returnArray(0, [], $result['message']);
- }
- }
-
- public function viewMail($data = [])
- {
- $result = $this->get($this->apiUrl.'/view-mail', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '获取邮件详情成功');
- } else {
- return $this->returnArray(0, [], '获取邮件详情失败');
- }
- }
- public function viewMailRecord($data = [])
- {
- $result = $this->get($this->apiUrl.'/view-mail-record', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '获取邮件详情成功');
- } else {
- return $this->returnArray(0, [], '获取邮件详情失败');
- }
- }
-
- public function saveMail($data = [])
- {
- $result = $this->post($this->apiUrl.'/save-mail', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '新增成功');
- } else {
- return $this->returnArray(0, [], '新增失败');
- }
- }
-
- public function delMail($data = [])
- {
- $result = $this->post($this->apiUrl.'/del-mail', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '删除成功');
- } else {
- return $this->returnArray(0, [], '删除失败');
- }
- }
-
- public function sendMail($data = [])
- {
- $result = $this->post($this->apiUrl.'/send-mail', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '发送成功');
- } else {
- return $this->returnArray(0, [], '发送失败');
- }
- }
- public function sendMailRecord($data = [])
- {
- $result = $this->post($this->apiUrl.'/send-mail-record', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '发送成功');
- } else {
- return $this->returnArray(0, [], '发送失败');
- }
- }
- public function delMailRecord($data = [])
- {
- $result = $this->post($this->apiUrl.'/del-mail-record', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '删除成功');
- } else {
- return $this->returnArray(0, [], '删除失败');
- }
- }
- public function Statistics($data = [])
- {
- $result = $this->post($this->apiUrl.'/statistics', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '查找成功');
- } else {
- return $this->returnArray(0, [], '查找失败');
- }
- }
- }
|