<?php

namespace Modules\Mall\Models;

use App\Models\Model;
use App\Traits\HasCovers;
use App\Traits\WithPosition;
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Linker\Traits\HasLinker;
use Modules\Mall\Models\Traits\BelongsToShop;

class Banner extends Model
{

    use BelongsToShop,
        Cachable,
        HasCovers,
        SoftDeletes,
        HasLinker,
        WithPosition;

    const POSITION_INDEX        = 1;
    const POSITION_INDEX_CENTER = 2;

    public array $position_map = [
        self::POSITION_INDEX        => '首页顶部',
    ];

    protected $table = 'mall_banners';

}
