如题,场景是成功发送短信后插入一条记录,条件是该日不超过短信发送上限【防止恶意发送短信】,伪代码如下
`#DAY_SEND_LIMIT=5
INSERT sms_send_record(mobile,sendDate) VALUES( '13888888888', NOW()) WHERE (SELECT COUNT(*) FROM sms_send_record WHERE mobile='13888888888' AND TO_DAYS(sendDate)= TO_DAYS(NOW()) <DAY_SEND_LIMIT )`
自己去写业务代码控制这个操作,别啥都丢到sql里面处理