|
@@ -15,7 +15,7 @@ class Model_check extends Lin_Model
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
$limit_time = time() - 72*60*60;
|
|
$limit_time = time() - 72*60*60;
|
|
|
- $info = $this->find("(addtime >= ".$limit_time.") and ((check_name = '".$check_name."') or (check_address like '%".$check_address."%'))","*",'addtime DESC');
|
|
|
|
|
|
|
+ $info = $this->find("(status = 1) and (addtime >= ".$limit_time.") and ((check_name = '".$check_name."') or (check_address like '%".$check_address."%'))","*",'addtime DESC');
|
|
|
|
|
|
|
|
if(empty($info)){
|
|
if(empty($info)){
|
|
|
|
|
|
|
@@ -35,6 +35,24 @@ class Model_check extends Lin_Model
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function allowOverdue($check_name,$number,$check_address){
|
|
|
|
|
+ $check_name = trim($check_name);
|
|
|
|
|
+ $check_address = trim($check_address);
|
|
|
|
|
+ if(empty($check_name) || empty($check_address)){
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ $limit_time = time() - 72*60*60;
|
|
|
|
|
+ $info = $this->find("(status = 1) and (addtime >= ".$limit_time.") and ((check_name = '".$check_name."') or (check_address like '%".$check_address."%'))","*",'addtime DESC');
|
|
|
|
|
+ if(empty($info)){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if($info['number'] == $number){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ $this->save(['status'=>0],$info['id']);
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function checkOverduetest($check_name,$number,$check_address){
|
|
public function checkOverduetest($check_name,$number,$check_address){
|
|
|
$check_name = trim($check_name);
|
|
$check_name = trim($check_name);
|
|
|
$check_address = trim($check_address);
|
|
$check_address = trim($check_address);
|
|
@@ -42,7 +60,7 @@ class Model_check extends Lin_Model
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
$limit_time = time() - 72*60*60;
|
|
$limit_time = time() - 72*60*60;
|
|
|
- $info = $this->find("(addtime >= ".$limit_time.") and ((check_name = '".$check_name."') or (check_address like '%".$check_address."%'))","*",'addtime DESC');
|
|
|
|
|
|
|
+ $info = $this->find("(status = 1) and (addtime >= ".$limit_time.") and ((check_name = '".$check_name."') or (check_address like '%".$check_address."%'))","*",'addtime DESC');
|
|
|
|
|
|
|
|
if(empty($info)){
|
|
if(empty($info)){
|
|
|
|
|
|