Support.php
2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* 其他运费支持
* @author tongdesheng
*
*/
class YHMApi_App_V1_Support extends YHMApi_App_V1_Base {
/**
* 添加建议
* @param array $params
* @param string $fields
*/
public static function setAdvise(array $params, $fields = '*') {
if (empty($params['uid'])) {
return self::result(400, "uid不能为空");
}
if (empty($params['content'])) {
return self::result(400, "投诉内容不能为空");
}
$id = YHMSupport_Models_Advise_Client::setAdvise($params['uid'], $params['content'],$params['client_version'], $params['client_type'], $params['os_version']);
if ($id < 1) {
return self::result(500, "提交失败");
}
return self::result(200, "提交成功", $id);
}
/**
* 获取通知设置
* @param array $params
* @param string $fields
*/
public static function getNoticeSetting(array $params, $fields = '*') {
if (empty($params['uid'])) {
return self::result(400, 'uid不能为空');
}
$uid = $params['uid'];
$Data = YHMSupport_Models_Notice_Client::getOne($uid);
$settingData = array(
'uid' => $Data['uid'],
'message_notice' => $Data['message_notice'],
'order_notice' => $Data['order_notice'],
'system_notice' => $Data['system_notice'],
'start_time' => $Data['notice_begin_time'],
'end_time' => $Data['notice_end_time']
);
if (empty($Data)) {
$settingData = array(
'uid' => $uid,
'message_notice' => 'Y',
'order_notice' => 'Y',
'system_notice' => 'Y',
'start_time' => '08:00:00',
'end_time' => '20:00:00'
);
}
return self::result(200, '获取成功', $settingData);
}
/**
* 设置通知参数
* @param array $params
* @param string $fields
*/
public static function setNoticeSetting(array $params, $fields = '*') {
if (empty($params['uid'])) {
return self::result(400, 'uid不能为空');
}
$uid = $params['uid'];
$message_notice = empty($params['message_notice']) ? 'Y' : $params['message_notice'] ;
$order_notice = empty($params['order_notice']) ? 'Y' : $params['order_notice'];
$system_notice = empty($params['system_notice']) ? 'Y' :$params['system_notice'];
$start_time = empty($params['start_time']) ? '08:00' : $params['start_time'];
$end_time = empty($params['end_time']) ? '20:00' : $params['end_time'];
YHMSupport_Models_Notice_Client::setNoticeByUid($uid, $message_notice, $order_notice, $system_notice, $start_time, $end_time);
return self::result(200, '设置成功');
}
}