55 lines
1.4 KiB
PHP
55 lines
1.4 KiB
PHP
<?php
|
|
namespace app\common\model\marketing;
|
|
|
|
use app\common\model\BaseModel;
|
|
use app\common\model\store\order\StoreOrder;
|
|
use app\common\model\user\User;
|
|
use app\common\model\user\UserOrder;
|
|
|
|
class AgentBrokerage extends BaseModel{
|
|
|
|
|
|
public static function tablePk(): string{
|
|
return 'id';
|
|
}
|
|
|
|
public static function tableName(): string{
|
|
return 'agent_brokerage';
|
|
}
|
|
|
|
|
|
public function userOrder(){
|
|
return $this->hasOne(UserOrder::class,'order_id', 'user_order_id');
|
|
}
|
|
public function storeOrder(){
|
|
return $this->hasOne(StoreOrder::class,'order_id', 'user_order_id');
|
|
}
|
|
public function staff(){
|
|
return $this->hasOne(User::class,'uid', 'staff_uid');
|
|
}
|
|
public function store(){
|
|
return $this->hasOne(User::class,'uid', 'store_uid');
|
|
}
|
|
public function area(){
|
|
return $this->hasOne(User::class,'uid', 'area_uid');
|
|
}
|
|
public function areaStore(){
|
|
return $this->hasOne(User::class,'uid', 'area_store_uid');
|
|
}
|
|
public function delivery(){
|
|
return $this->hasOne(User::class,'uid', 'delivery_uid');
|
|
}
|
|
public function province(){
|
|
return $this->hasOne(User::class,'uid', 'province_uid');
|
|
}
|
|
public function initiator(){
|
|
return $this->hasOne(User::class,'uid', 'initiator_uid');
|
|
}
|
|
public function fieldStaff(){
|
|
return $this->hasOne(User::class,'uid', 'field_staff_uid');
|
|
}
|
|
|
|
|
|
|
|
}
|