| 12345678910111213141516171819202122232425262728293031 |
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Model_check extends Lin_Model
- {
- function __construct(){
- parent::__construct();
- $this->load->database();
- $this->table = 'check';
- $this->load_table('check');
- }
-
- public function checkOverdue($check_name,$number){
- $check_name = trim($check_name);
- $info = $this->find("check_name = '$check_name'");
- if(empty($info)){
- }else{
- if(($info['addtime'] - time()) < $info['zx_hours']*60*60 ){
- return false;
- }
- }
-
- $this->insert([
- 'check_name' => $check_name,
- 'number' => $number,
- 'addtime' => time(),
- 'zx_hours'=> 72
- ]);
- return true;
- }
-
- } //end class
|