-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tomoya
committed
Mar 25, 2016
1 parent
238128d
commit 0533e96
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.jfinalbbs.module.valicode; | ||
|
||
import com.jfinalbbs.common.BaseModel; | ||
import com.jfinalbbs.utils.DateUtil; | ||
|
||
import java.io.Serializable; | ||
import java.util.Date; | ||
|
||
/** | ||
* Created by Tomoya. | ||
* Copyright (c) 2016, All Rights Reserved. | ||
* http://jfinalbbs.com | ||
*/ | ||
public class Valicode extends BaseModel<Valicode> implements Serializable { | ||
public final static Valicode me = new Valicode(); | ||
|
||
//查询未过期的验证码 | ||
public Valicode findByCodeAndEmail(String code, String email, String type) { | ||
String nowTime = DateUtil.formatDateTime(new Date()); | ||
return super.findFirst("select * from jfbbs_valicode v where v.status = 0 and v.code = ? and v.target = ? and v.expire_time > ? and v.type = ?", code, email, nowTime, type); | ||
} | ||
} |