|
|
@ -0,0 +1,22 @@ |
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
|
|
namespace App\Models; |
|
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory; |
|
|
|
|
|
use Illuminate\Database\Eloquent\Model; |
|
|
|
|
|
|
|
|
|
|
|
class UserFav extends BaseModel |
|
|
|
|
|
{ |
|
|
|
|
|
use HasFactory; |
|
|
|
|
|
protected $guarded = ['id', 'created_at', 'updated_at']; //不允许批量赋值的字段
|
|
|
|
|
|
|
|
|
|
|
|
public function agentProduct() |
|
|
|
|
|
{ |
|
|
|
|
|
return $this->belongsTo(AgentProduct::class); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function product() |
|
|
|
|
|
{ |
|
|
|
|
|
return $this->belongsTo(Product::class); |
|
|
|
|
|
} |
|
|
|
|
|
} |