Home Backend Development PHP Tutorial 积分处理解决思路

积分处理解决思路

Jun 13, 2016 am 10:06 AM
check time where

积分处理
会员在当天登录只记一次分,怎么处理,求思路,数据库最后登录的时间 类型时间戳

------解决方案--------------------
记录时间与ip。判断今天这ip是否存在。不存在才做积分累加
------解决方案--------------------

探讨

引用:

记录时间与ip。判断今天这ip是否存在。不存在才做积分累加


那换个IP登录呢。

------解决方案--------------------
其实我觉的用在线时间就可以了,就是今天上线了多长时间,只要有在线时间就记分,如果没有就代表他没登录过
------解决方案--------------------

取得这个最后时间 小于 date('Y-m-d', time()) 才加积分

再更改会员最后登录时间。


探讨

引用:

引用:

引用:

记录时间与ip。判断今天这ip是否存在。不存在才做积分累加


那换个IP登录呢。


竟然是会员了。就不用ip拉用时间与会员判断即可了


再请教,能说详细点吗,判断用户是不是当天登录,也就晚上1点的时候到24点都可以加分

------解决方案--------------------
1.就是建立一个数据库表check,里面有 member(会员),time(时间)两个字段----其实你也可以按需求添加其他字段
2.会员登录的时候,判断一下会员今天有没有登录(select * from check where member='$user' and time='$now'),如果存在,就不执行积分操作,不存在就执行积分操作,并把会员名与时间插入到今天的check表
(insert into check (`member`,`time`) values ('$user','$now'))
3.为了数据库优化,建议定期清理check表(比如一天清理一次:delete from check where time  
------解决方案--------------------
时间比较一下
------解决方案--------------------
上面的是伪代码,只是让你看的更明白
具体的有可能需要修改一下
------解决方案--------------------
test 回复
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

17 ways to solve the kernel_security_check_failure blue screen 17 ways to solve the kernel_security_check_failure blue screen Feb 12, 2024 pm 08:51 PM

Kernelsecuritycheckfailure (kernel check failure) is a relatively common type of stop code. However, no matter what the reason is, the blue screen error causes many users to be very distressed. Let this site carefully introduce 17 types to users. Solution. 17 solutions to kernel_security_check_failure blue screen Method 1: Remove all external devices When any external device you are using is incompatible with your version of Windows, the Kernelsecuritycheckfailure blue screen error may occur. To do this, you need to unplug all external devices before trying to restart your computer.

How to turn off Palm Check in Windows 11/10 How to turn off Palm Check in Windows 11/10 Feb 19, 2024 pm 09:45 PM

This article will guide you to turn off the PalmCheck function on Windows 11/10 PC. PalmCheck is a feature designed to prevent accidental palm or other touches from being mistakenly recognized as input when typing on the keyboard. This is usually found in touchpad settings, especially on touch-enabled devices like laptops. Sometimes you may want to turn off PalmCheck or a similar feature to give you more flexibility in controlling input in situations where you need to use both the keyboard and touchpad. In this article, we will introduce how to disable PalmCheck function on Windows 11/10 PC, so that you can better cope with the needs when gaming or running applications. What is the P on the touchpad?

Monotonic clock processing of time package Monotonic clock processing of time package Aug 04, 2023 pm 05:45 PM

Today we are mainly going to take a look at the time application method of golang time package. The general rule between the two is that "wall time" is used to tell time, and "monotonic clock" is used to measure time; there are other clock processing methods.

Interpretation of Linux system Keepalived health check mechanism Interpretation of Linux system Keepalived health check mechanism Feb 28, 2024 am 09:52 AM

When performing load balancing, a health check tool is generally deployed to ensure that the backend realserver is normal and can provide services. To avoid the situation where the backend realserver is down or the service is unavailable, the load balancer will distribute the request to the realserver. Impact on overall business access. There are many ways to perform health checks, and you can deploy scripts by yourself. Of course, the most commonly used one is the keepalived service. There are three health check methods for keepalived, tcp_check, http_check, and misc_check. Keepalived configuration brief keepalived has three main modules, namely core,

A Practical Guide to the Where Method in Laravel Collections A Practical Guide to the Where Method in Laravel Collections Mar 10, 2024 pm 04:36 PM

Practical Guide to Where Method in Laravel Collections During the development of the Laravel framework, collections are a very useful data structure that provide rich methods to manipulate data. Among them, the Where method is a commonly used filtering method that can filter elements in a collection based on specified conditions. This article will introduce the use of the Where method in Laravel collections and demonstrate its usage through specific code examples. 1. Basic usage of Where method

How to use the Where method in Laravel collections How to use the Where method in Laravel collections Mar 10, 2024 pm 10:21 PM

How to use the Where method in Laravel collection Laravel is a popular PHP framework that provides a wealth of functions and tools to facilitate developers to quickly build applications. Among them, Collection is a very practical and powerful data structure in Laravel. Developers can use collections to perform various operations on data, such as filtering, mapping, sorting, etc. In collections, the Where method is a commonly used method for filtering the collection based on specified conditions.

From beginner to proficient: Master the skills of using is and where selectors From beginner to proficient: Master the skills of using is and where selectors Sep 08, 2023 am 09:15 AM

From beginner to proficient: Master the skills of using is and where selectors Introduction: In the process of data processing and analysis, the selector is a very important tool. Through selectors, we can extract the required data from the data set according to specific conditions. This article will introduce the usage skills of is and where selectors to help readers quickly master the powerful functions of these two selectors. 1. Use of the is selector The is selector is a basic selector that allows us to select the data set based on given conditions.

How to use Java8 Time API How to use Java8 Time API Apr 28, 2023 pm 12:25 PM

1. Overview As part of this article, let us start with some problems with the existing Date and CalendarAPI and explore how the new Java8Date and TimeAPI solve these problems. We will also take a look at the core classes in the Java8 time class library, such as LocalDate, LocalTime, LocalDateTime, ZonedDateTime, Period, Duration and their APIs. 2. The problem of thread safety of the old time API (before Java 8)-Date and Calendar classes are not thread-safe, making it difficult for developers to debug concurrency problems of these APIs and need to write additional code to deal with them.

See all articles