Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoya committed Mar 25, 2016
1 parent 238128d commit 0533e96
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/com/jfinalbbs/module/valicode/Valicode.java
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);
}
}

0 comments on commit 0533e96

Please sign in to comment.