电子商务网站优惠券有关问题
电子商务网站优惠券问题
现在有个网站会员有个优惠券功能
注册送优惠券(有效期一年)
够买东西返还优惠券(有效期不限)
节假日送优惠券(具体时间金额啥的后台人员定义)
我的做法是这样的
member 表名
userid 会员ID字段
yhq 是优惠券字段(存放优惠券金额总和)
把优惠券曾送时间,到期时间,说明单独放到一个表里,
表名是yhq
id 优惠券ID字段
userid 会员ID字段
title 优惠券标题
start_time 曾送时间
end_time 到期时间
price 金额
但是现在有个问题就是到期问题
假如现在有个会员今天注册了,送个20元优惠券,明天买东西花掉10元,还剩10元
过几天会员没有事发发帖子又赚了20元优惠券
一年后按要求应该要扣掉10元的,但是程序不知道啊。
求高手帮忙解决一下
或者你们做优惠券有没有碰到这样的问题。是怎么解决的谢谢。
------解决方案--------------------
那你到底是原来的1年后过期呢还是后来赠送的都一起过期?还是原来的10元过期,后来的也需要累计到一年的时间后过期?
如果是后面的 我觉得你就应该要分开来设计表 将优惠卷单独用个表来记录 就简单解决了
------解决方案--------------------
好像没有问题啊,另外从应用上来讲,每张优惠劵不能拆开使用的吧,只能一次性使用的好像
------解决方案--------------------
一张优惠券应该只能使用一次做限制。
比如你去商场购物 有100优惠券,应该不存在用了50 还剩下50的情况。
------解决方案--------------------
1. 优惠券不应该有总和的概念,专门做个表存用户的所有优惠券吧。
2. 优惠券都是一次性消费的
3. 然后。。。就没有然后了

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Fujifilm fans were recently very excited at the prospect of the X-T50, since it presented a relaunch of the budget-oriented Fujifilm X-T30 II that had become quite popular in the sub-$1,000 APS-C category. Unfortunately, as the Fujifilm X-T50's launc

TheFiiOCP13cassetteplayerwasannouncedinJanuary.Now,FiiOisexpandingitsportfoliowithtwonewmodels-onewitharedfrontandonewithatransparentfront.Thelatternotonlyperfectlymatchestheretrocharmoftheangulardesign,butalso

Solution to docker start failure: 1. Check the running status, and then release the occupied memory through the "echo 3 > /proc/sys/vm/drop_caches" command; 2. Use "$netstat -nltp|grep .. ." command to check whether the port has been occupied. If it is found to be occupied after going online, change it to an available port and restart.

The Klipsch Flexus Core 300 is the top model in the series and is positioned above the already available Flexus Core 200 in the company's soundbar line-up. According to Klipsch, this is the first soundbar in the world whose sound can be adapted to th

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.

WhiletheLightPhone2from2018wasstillequippedwithaneconomicale-inkdisplay,theLightPhone3usesanOLEDdisplaythatcanonlydisplaygrayscale.Thereasonfortheswitchtothe3.92-inchOLEDpanelwithitsresolutionof1,240x1,080isth

Shortly after Tesla launched the Model 3 Highland refresh towards the end of last year, the US federal EV tax incentive rules changed, cutting the potential discount in half for eligible buyers because of Tesla's use of Chinese LFP cells in the new M

There have been multiple reports about Qualcomm increasing the price of Snapdragon 8 Gen 4 compared to its current-gen flagship SoC. Digital Chat Station, a notable leakster, reported about it back in May, which was later reinforced with a separate r
