123456789101112131415161718192021222324 |
- <?php
- namespace Api\Model;
- use Api\Model\BaseModel;
- class CaptchaModel extends BaseModel {
- public function check($captcha_id , $captcha, $none =''){
- $time = time() ;
- $captcha_id = intval($captcha_id) ;
- $captcha_array = $this->where(" captcha_id = '$captcha_id' and expire_time > $time ")->find();
- if ($captcha_array['captcha'] && $captcha_array['captcha'] == $captcha) {
-
- $this->where(" captcha_id = '$captcha_id'")->save(array("expire_time"=>0));
- return true ;
- }else{
-
-
- }
- return false;
- }
- }
|