24 lines
		
	
	
		
			637 B
		
	
	
	
		
			PHP
		
	
	
		
		
			
		
	
	
			24 lines
		
	
	
		
			637 B
		
	
	
	
		
			PHP
		
	
	
| 
								 | 
							
								<?php
							 | 
						||
| 
								 | 
							
								namespace app\model;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								//特殊路由表
							 | 
						||
| 
								 | 
							
								class SpecialRoute extends Base
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    const type_archives             = "archives";
							 | 
						||
| 
								 | 
							
								    const type_archives_category    = "archives_category";
							 | 
						||
| 
								 | 
							
								    public static function findOneByUrl(string $url="")
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        return self::where('route', $url)->find();
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    public static function deleteByTypeIds($ids,$type)
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        return self::where([['relation_id', "in",$ids],["type","=",$type]])->delete();
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								    public static function findByTypeRelaTioneId($relationId,$type)
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        return self::where([['relation_id', "=",$relationId],["type","=",$type]])->find();
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |