diff --git a/Data/Shadowsocks-planel-DB.sql b/Data/Shadowsocks-planel-DB.sql index 884c7cf9..477ce4a6 100644 --- a/Data/Shadowsocks-planel-DB.sql +++ b/Data/Shadowsocks-planel-DB.sql @@ -134,3 +134,7 @@ INSERT INTO `node` (`id`, `name`, `type`, `server`, `method`, `info`, `status`, INSERT INTO `message` (`id`, `content`, `pushTime`, `addTime`, `pushUsers`, `type`, `pushEndTime`, `order`) VALUES ('1000', '公告:
由于服务器遭到攻击,为补偿用户。本月不计费。(悲剧的事情莫过于挂SS主站的服务器居然被封了25端口)
', '1457320205', '1457320205', '-1', '-2', '1488856205', '0'); INSERT INTO `message` (`id`, `content`, `pushTime`, `addTime`, `pushUsers`, `type`, `pushEndTime`, `order`) VALUES ('1001', '套餐等级如下:

套餐A: 5GB(免费) (体验服务)
套餐B: 100GB(13RMB)
套餐C: 200GB(20RMB)
套餐D: 500GB(35RMB)

套餐VIP: 无限制流量,优先端口转发(仅内部开放)', '1457320205', '1457320205', '-1', '-3', '1488856205', '0'); INSERT INTO `message` (`id`, `content`, `pushTime`, `addTime`, `pushUsers`, `type`, `pushEndTime`, `order`) VALUES ('1002', '首页浮动提示公告测试。。', '0', '0', '-1', '-4', '0', '0'); + +UPDATE `message` SET `pushUsers`='-2', `type`='-2', WHERE (`id`='1000'); +UPDATE `message` SET `pushUsers`='-2', `type`='-3', WHERE (`id`='1001'); +UPDATE `message` SET `pushUsers`='-2', `type`='-4', WHERE (`id`='1002'); \ No newline at end of file diff --git a/Library/Controller/Admin/Message.php b/Library/Controller/Admin/Message.php index 1794b36c..a9fd629f 100644 --- a/Library/Controller/Admin/Message.php +++ b/Library/Controller/Admin/Message.php @@ -20,7 +20,7 @@ class Message extends AdminListener { public function index() { global $user; - $lists = MessageModel::GetPushMsg(); + $lists = MessageModel::GetPushMsg(-1); include Template::load('/admin/message'); } diff --git a/Library/Controller/Form.php b/Library/Controller/Form.php index 95c17cb6..b541f008 100644 --- a/Library/Controller/Form.php +++ b/Library/Controller/Form.php @@ -136,7 +136,7 @@ public function buyInvite() { $user->transfer = $user->transfer - $tr; $user->invite_num = $user->invite_num + 1; $user->updateUser(); - $result = array('error' => 0, 'message' => '购买成功,扣除手续费10GB流量'); + $result = array('error' => 0, 'message' => '购买成功,扣除手续费10GB流量', 'invite_num' => $user->invite_num); } echo json_encode($result); exit(); diff --git a/Library/Model/Message.php b/Library/Model/Message.php index 10855fe9..99b653da 100644 --- a/Library/Model/Message.php +++ b/Library/Model/Message.php @@ -37,7 +37,9 @@ public static function GetMessageById($msgId) { * @return message[] */ public static function GetPushMsg($pushEndTime = 0) { - if ($pushEndTime == 0) $pushEndTime = time(); + if ($pushEndTime == 0) + $pushEndTime = time(); + $statement = Database::prepare("SELECT * FROM message WHERE pushEndTime>?"); $statement->bindValue(1, $pushEndTime); $statement->execute(); @@ -64,7 +66,7 @@ public static function GetPushMsgByUserId($userId = "-1") { * @return message list */ public static function GetGlobalMessage() { - $statement = Database::prepare("SELECT * FROM message WHERE pushUsers=-1 AND type BETWEEN -5 AND -2 ORDER BY id ASC"); + $statement = Database::prepare("SELECT * FROM message WHERE pushUsers=-2 AND type BETWEEN -5 AND -2 ORDER BY id ASC"); $statement->execute(); $list = $statement->fetchAll(\PDO::FETCH_CLASS, '\\Model\\Message'); return $list; diff --git a/Template/Default/admin/_header.htm b/Template/Default/admin/_header.htm index b09efb35..424cedf0 100644 --- a/Template/Default/admin/_header.htm +++ b/Template/Default/admin/_header.htm @@ -152,6 +152,12 @@

+
  • + + + 消息管理 + +
  • diff --git a/Template/Default/admin/message.htm b/Template/Default/admin/message.htm new file mode 100644 index 00000000..df84902f --- /dev/null +++ b/Template/Default/admin/message.htm @@ -0,0 +1,211 @@ + + + +
    +
    +

    消息管理 + 添加

    +

    请注意消息的分类!

    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ID内容结束推送时间推送至类型操作
    #{$msg->id} {(mb_substr(htmlspecialchars($msg->content),0,20,'utf-8'))} {(date("Y-m-d H:i:s", $msg->pushEndTime))}系统消息系统固定消息推送值特定用户重复推送系统公告套餐处说明首页浮动提示普通消息 + 编辑 + + 删除 + +
    #没有节点
    +
    +
    +
    +
    +
    + + + + + + diff --git a/Template/Default/panel/invite.htm b/Template/Default/panel/invite.htm index 8df676fd..72f49f00 100644 --- a/Template/Default/panel/invite.htm +++ b/Template/Default/panel/invite.htm @@ -4,7 +4,7 @@

    邀请码

    -

    查看自己的邀请码当前您可以生成{$user->invite_num}个邀请码。

    +

    查看自己的邀请码当前您可以生成{$user->invite_num}个邀请码。