rabin 2 months ago
parent
commit
0ba5e631b7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Type/Code.php

+ 1 - 1
lib/Type/Code.php

@@ -37,7 +37,7 @@ class Code
     # 检测并使用验证码
     public function check($template_id, $account, $code, $update = 1)
     {
-        $info = Dever::db('code', 'msg')->find(array('template_id' => $template_id, 'account' => $account));
+        $info = Dever::db('code', 'msg')->find(array('template_id' => $template_id, 'account' => $account), array('order' => 'cdate desc'));
         if ($info && $info['status'] == 1 && $code == $info['code']) {
             if ($update == 1) {
                 Dever::db('code', 'msg')->update($info['id'], array('status' => 2));