/** * TrackEmailSmtpModel::delTrackEmailSmtp() * 邮件服务配置删除 * @param integer $id 邮件服务配置ID * @return bool */ public static function delTrackEmailSmtp($id) { self::initDB(); $sql = "UPDATE `" . self::$prefix . self::$table . "` SET is_delete = 1 WHERE id = {$id}"; $query = self::$dbConn->query($sql); if ($query) { $rows = self::$dbConn->affected_rows(); if ($rows) { return $rows; } else { self::$errCode = 30001; self::$errMsg = "删除数据失败"; return false; } } else { self::$errCode = 30000; self::$errMsg = "执行SQL语句失败!"; return false; } }
/** * TrackEmailSmtpAct::act_delTrackEmailSmtp() * 删除邮件服务配置 * @param int $id 邮件服务配置ID * @return bool */ public function act_delTrackEmailSmtp() { $id = isset($_POST["id"]) ? intval(trim($_POST["id"])) : 0; $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 30001; self::$errMsg = "对不起,您无数据删除权限!"; return false; } if (empty($id) || !is_numeric($id)) { self::$errCode = 30000; self::$errMsg = "邮件服务配置ID有误!"; return false; } $res = TrackEmailSmtpModel::delTrackEmailSmtp($id); self::$errCode = TrackEmailSmtpModel::$errCode; self::$errMsg = TrackEmailSmtpModel::$errMsg; return $res; }