123456789101112131415161718192021222324252627 |
- <?php
- namespace App\Models;
- class ScaleCategory extends SoftBaseModel
- {
- //是否投放首页
- const isIndexYes = 1;
- const isIndexNo = 0;
- const isIndexMap = array(
- self::isIndexYes => "是",
- self::isIndexNo => "否"
- );
- public function getPicAttribute()
- {
- return isset($this->attributes['pic']) ? config('console.pic_path').$this->attributes['pic'] : NULL;
- }
- public function getPic2Attribute()
- {
- return isset($this->attributes['pic2']) ? config('console.pic_path').$this->attributes['pic2'] : NULL;
- }
- public function Childrens()
- {
- return $this->hasMany(ScaleCategory::class, 'pid');
- }
- }
|