40 lines
		
	
	
		
			733 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
		
		
			
		
	
	
			40 lines
		
	
	
		
			733 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| 
								 | 
							
								<?php
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								namespace addons\cardocr\model;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								use think\Cache;
							 | 
						||
| 
								 | 
							
								use think\Db;
							 | 
						||
| 
								 | 
							
								use think\Model;
							 | 
						||
| 
								 | 
							
								use think\View;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * 身份证模型
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								class Cardocr extends Model
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    protected $name = "cardocr";
							 | 
						||
| 
								 | 
							
								    // 开启自动写入时间戳字段
							 | 
						||
| 
								 | 
							
								    protected $autoWriteTimestamp = 'int';
							 | 
						||
| 
								 | 
							
								    // 定义时间戳字段名
							 | 
						||
| 
								 | 
							
								    protected $createTime = 'createtime';
							 | 
						||
| 
								 | 
							
								    protected $updateTime = 'updatetime';
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    // 追加属性
							 | 
						||
| 
								 | 
							
								    protected $append = [
							 | 
						||
| 
								 | 
							
								    ];
							 | 
						||
| 
								 | 
							
								    protected static $config = [];
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    protected static function init()
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        $config = get_addon_config('cardocr');
							 | 
						||
| 
								 | 
							
								        self::$config = $config;
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    public function model()
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        return $this->belongsTo('Modelx', 'model_id')->setEagerlyType(0);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |