public function __construct($globalMsg = '') { if ($globalMsg != '') { $this->_globalMsg = $globalMsg; } parent::__construct(); }
public function __construct($contentType = '', $data = '') { if ($contentType != '' && $data != '') { $this->_contentType = $contentType; $this->data = $data; } parent::__construct(); }
public function __construct($class = '') { if ($class != '') { $this->_className = $class; } else { $this->throwError('include the className when creating a AVObject'); } parent::__construct(); }
public function __construct($function = '') { $this->_options = array(); if ($function != '') { $this->_functionName = $function; } else { $this->throwError('include the functionName when creating a AVCloud'); } parent::__construct(); }
public function __construct($class = '') { if ($class == 'users' || $class == 'installation') { $this->_requestUrl = $class; } elseif ($class != '') { $this->_requestUrl = 'classes/' . $class; } else { $this->throwError('include the className when creating a AVQuery'); } parent::__construct(); }
function delete() { $ids = trim(urldecode($this->input['id'])); if (!$this->input['id']) { $this->errorOutput(NOID); } $sql = "SELECT * FROM " . DB_PREFIX . "notice WHERE id IN(" . $ids . ")"; $q = $this->db->query($sql); $msg_id = array(); while ($row = $this->db->fetch_array($q)) { if ($row['platform_type'] == 3 && $row['msg_id'] && $row['send_time'] > TIMENOW && $row['app_id']) { $msg_id[$row['app_id']][] = $row['msg_id']; $app_id[] = $row['app_id']; } $app_id[] = $row['app_id']; $sorts[] = $row['app_id']; $advInfor[$row['id']] = $row; } /**************权限控制开始**************/ //节点验证 if ($sorts && $this->user['group_type'] > MAX_ADMIN_TYPE) { $sorts = array_filter($sorts); if (!empty($sorts)) { $nodes['nodes'][$app_id] = implode(',', $sorts); if (!empty($nodes)) { $nodes['_action'] = 'notice_manage'; $this->verify_content_prms($nodes); } } } //能否修改他人数据 if (!empty($advInfor) && $this->user['group_type'] > MAX_ADMIN_TYPE) { foreach ($advInfor as $val) { $this->verify_content_prms(array('id' => $val['id'], 'user_id' => $val['user_id'], 'org_id' => $val['org_id'], '_action' => 'notice_manage')); } } /**************权限控制结束**************/ /**************avos同步删除未发送出去消息***************/ if (!empty($msg_id)) { include_once CUR_CONF_PATH . 'lib/avos/AV.php'; $obj = new AVRestClient(); $sql = "SELECT * FROM " . DB_PREFIX . "app_info WHERE id IN (" . implode(',', $app_id) . ")"; $query = $this->db->query($sql); while ($r = $this->db->fetch_array($query)) { $app_info[$r['id']] = $r; } $args = array('method' => 'DELETE'); foreach ($app_info as $appid => $appinfo) { if (!$msg_id[$appid]) { continue; } foreach ($msg_id[$appid] as $msgid) { $appinfo['avos_url'] = 'https://leancloud.cn/1.1/classes/_Notification/' . $msgid; $obj->request($args, $appinfo); } } } $sql = 'DELETE FROM ' . DB_PREFIX . 'notice WHERE id IN (' . $ids . ')'; $this->db->query($sql); $this->addItem('success'); $this->output(); }