AdPosition.php 539 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Modules\AdPosition\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class AdPosition extends Model
  5. {
  6. protected $table = 'qapp_ad_position';
  7. protected $fillable = ['name', 'ident', 'max_num', 'content_type', 'property', 'show_type', 'status', 'default_img'];
  8. /**
  9. * 获取所有有效的广告位
  10. * @return array
  11. */
  12. public static function getAllValidAdPositions(): array
  13. {
  14. $result = self::where('status', 1)->get();
  15. return $result ? $result->toArray() : [];
  16. }
  17. }