Files
water_new/modules/Mall/Models/Reason.php
2023-03-08 09:16:04 +08:00

31 lines
662 B
PHP

<?php
namespace Modules\Mall\Models;
use App\Models\Model;
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
class Reason extends Model
{
use Cachable,
SoftDeletes;
protected $table = 'mall_reasons';
/**
* Notes: 关联店铺
* @Author: 玄尘
* @Date : 2021/5/18 15:28
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function shops(): BelongsToMany
{
return $this->belongsToMany(Shop::class, 'mall_shop_reasons')
->withTimestamps();
}
}