You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
702 B
40 lines
702 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Demand extends BaseModel
|
|
{
|
|
use HasDateTimeFormatter;
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'demand';
|
|
|
|
public function publisher()
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
|
|
public function biddingUser()
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
|
|
public function product()
|
|
{
|
|
return $this->hasOne(Product::class, 'id', 'product_id');
|
|
}
|
|
|
|
public function agentproduct()
|
|
{
|
|
return $this->hasOne(AgentProduct::class, 'id', 'agent_product_id');
|
|
}
|
|
|
|
public function bidding()
|
|
{
|
|
return $this->hasOne(DemandBidding::class,'id','bidding_id');
|
|
}
|
|
}
|