public function Index() { global $user; $serverCount = \Model\Node::GetNodeCount(); $flow = $user->flow_up + $user->flow_down; //已用 $usedflow = Util::FlowAutoShow($user->transfer - $flow); //剩余可用 $user_100 = 0; if (!Member::fuckInt($flow) || !Member::fuckInt($user->transfer)) { $user_100 = round($flow / $user->transfer, 2) * 100; } if ($user_100 == 0) { $user_100 = 1; } $all_transfer = Util::FlowAutoShow($user->transfer); //共有流量 $flow = round($flow / Util::GetMB(), 2); $checkin = false; //是否可以签到 $checkinTime = date("m-d h:i", $user->lastCheckinTime); $lastConnTime = date("Y-m-d h:i:s", $user->lastConnTime); $nowUserIp = Util::GetUserIP(); $data = \Helper\Ana::getAnaCount(); $userCount = $data['userCount']; $checkCount = $data['checkCount']; $connCount = $data['connCount']; if (time() - 3600 * 24 < $user->lastCheckinTime) { $checkin = true; } include Template::load("panel/member"); }
public function CheckIn() { global $user; $user = User::GetUserByUserId($user->uid); $result = array('error' => 1, 'message' => ''); if ($user->lastCheckinTime <= time() - 3600 * 24) { $checkinTransfer = rand(5, 25) * Util::GetMB(); $user->lastCheckinTime = time(); $user->transfer = $user->transfer + $checkinTransfer; $user->updateUser(); $result['user'] = $user; $result['time'] = time(); $result['message'] = '签到成功, 获得' . Util::FlowAutoShow($checkinTransfer) . ' 流量'; } else { $result['message'] = '你已经在 ' . date('Y-m-d H:i:s', $user->lastCheckinTime) . " 时签到过."; } echo json_encode($result); exit; }
public function CheckIn() { global $user; $result = array('error' => 1, 'message' => ''); if ($user->lastCheckinTime >= 3600 * 24) { $checkinTransfer = rand(5, 25) * Util::GetMB(); $user->lastCheckinTime = time(); $user->transfer = $user->transfer + $checkinTransfer; $result['message'] = '签到成功, 获得' . $checkinTransfer . 'MB 流量'; } else { $result['message'] = '你已经在 ' . date('Y-m-d H:i:s', $user->lastCheckinTime) . " 时签到过."; } echo json_encode($result); exit; }