|
|
@@ -34,5 +34,38 @@ class Model_check extends Lin_Model
|
|
|
]);
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ public function checkOverduetest($check_name,$number,$check_address){
|
|
|
+ $check_name = trim($check_name);
|
|
|
+ $check_address = trim($check_address);
|
|
|
+ if(empty($check_name) || empty($check_address)){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $info = $this->find("(check_name = '".$check_name."') or (check_address like '%".$check_address."%')","*",'addtime DESC');
|
|
|
+
|
|
|
+ echo "<pre>";
|
|
|
+ print_r($info);
|
|
|
+ if(empty($info)){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ print_r(time());
|
|
|
+ print_r($info['addtime']);
|
|
|
+ if((time() - $info['addtime'] ) < $info['zx_hours']*60*60 ){
|
|
|
+ if($info['number'] == $number){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ $this->insert([
|
|
|
+ 'check_address' => $check_address,
|
|
|
+ 'check_name' => $check_name,
|
|
|
+ 'number' => $number,
|
|
|
+ 'addtime' => time(),
|
|
|
+ 'zx_hours'=> 72
|
|
|
+ ]);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
} //end class
|