| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Module\Article\Models;
- use Dcat\Admin\Traits\HasDateTimeFormatter;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- /**
- * App\Module\Article\Models\ArticleCate
- *
- * field start
- * @property int $id
- * @property int $pid 父级分类
- * @property string $title 标题
- * @property string $unid 标识
- * @property string $img 首图
- * @property int $status
- * @property string $desc1 分类描述
- * @property \Carbon\Carbon $created_at
- * @property \Carbon\Carbon $updated_at
- * @property \Carbon\Carbon $deleted_at 删除时间
- * @property int $can_delete 是否可以删除的分类
- * field end
- */
- class ArticleCate extends Model
- {
- use HasDateTimeFormatter;
- use SoftDeletes;
- protected $table = 'article_cates';
- // attrlist start
- protected $fillable = [
- 'id',
- 'pid',
- 'title',
- 'unid',
- 'img',
- 'status',
- 'desc1',
- 'can_delete',
- ];
- // attrlist end
- /**
- * 获取分类列表
- *
- * @return array
- */
- public static function getCate(): array
- {
- return self::pluck('title', 'id')->toArray();
- }
- }
|