new-admin-api/app/common/model/marketing/agent/AgentDelivery.php

38 lines
737 B
PHP

<?php
namespace app\common\model\marketing\agent;
use app\common\model\BaseModel;
use app\common\model\marketing\Agent;
use app\common\model\store\order\StoreOrder;
use app\common\model\system\merchant\Merchant;
class AgentDelivery extends BaseModel{
public static function tablePk(): string{
return 'id';
}
public static function tableName(): string{
return 'agent_delivery';
}
public function agent(){
return $this->hasOne(Agent::class, 'id', 'agent_id');
}
public function mer(){
return $this->hasOne(Merchant::class, 'mer_id', 'mer_id');
}
public function storeOrder(){
return $this->hasOne(StoreOrder::class, 'order_id', 'order_id');
}
}