first
This commit is contained in:
30
modules/Mall/Models/Reason.php
Normal file
30
modules/Mall/Models/Reason.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user