6
0
Fork 0
jiqu-library-server/app/Models/Tag.php

42 lines
798 B
PHP

<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Tag extends Model
{
use HasFactory;
use HasDateTimeFormatter;
// /**
// * 标签下的订单
// *
// */
// public function orders()
// {
// return $this->morphedByMany(Order::class, 'taggable');
// }
// /**
// * 标签下的包裹
// *
// */
// public function packages()
// {
// return $this->morphedByMany(OrderPackage::class, 'taggable');
// }
public function scopeOrderTag()
{
return $this->where('type', 1);
}
public function scopeOrderPackageTag()
{
return $this->where('type', 2);
}
}