<?php


namespace App\Modules\AdPosition\Models;


use Illuminate\Database\Eloquent\Model;

class AdPosition extends Model
{
    protected $table = 'qapp_ad_position';
    protected $fillable = ['name', 'ident', 'max_num', 'content_type', 'property', 'show_type', 'status', 'default_img'];

    /**
     * 获取所有有效的广告位
     * @return array
     */
    public static function getAllValidAdPositions(): array
    {
        $result = self::where('status', 1)->get();
        return $result ? $result->toArray() : [];
    }
}