You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							34 lines
						
					
					
						
							663 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							34 lines
						
					
					
						
							663 B
						
					
					
				
								<?php
							 | 
						|
								
							 | 
						|
								namespace App\Models;
							 | 
						|
								
							 | 
						|
								use Dcat\Admin\Traits\ModelTree;
							 | 
						|
								use Illuminate\Database\Eloquent\Factories\HasFactory;
							 | 
						|
								use Illuminate\Database\Eloquent\SoftDeletes;
							 | 
						|
								
							 | 
						|
								/**
							 | 
						|
								 * 频道列表
							 | 
						|
								 * Class Channel
							 | 
						|
								 * @package App\Models
							 | 
						|
								 */
							 | 
						|
								class Channel extends BaseModel
							 | 
						|
								{
							 | 
						|
								    use HasFactory, SoftDeletes;
							 | 
						|
									use ModelTree;
							 | 
						|
								
							 | 
						|
									// 模型树需要的三个属性
							 | 
						|
									protected $parentColumn = 'pid';
							 | 
						|
									protected $orderColumn = 'sort';
							 | 
						|
									protected $titleColumn = 'name';
							 | 
						|
								
							 | 
						|
								    public function __construct(array $attributes = [])
							 | 
						|
									{
							 | 
						|
										parent::__construct($attributes);
							 | 
						|
										$this->timestamps = false;
							 | 
						|
									}
							 | 
						|
								
							 | 
						|
									public function parent()
							 | 
						|
									{
							 | 
						|
										return $this->hasOne(self::class, 'id', 'pid');
							 | 
						|
									}
							 | 
						|
								}
							 |