new-admin-api/app/common/model/marketing/AgentApply.php

40 lines
935 B
PHP

<?php
namespace app\common\model\marketing;
use app\common\model\BaseModel;
use app\common\model\store\CityArea;
use app\common\model\user\User;
class AgentApply extends BaseModel{
public static function tablePk(): string{
return 'id';
}
public static function tableName(): string{
return 'agent_apply';
}
public function user(){
return $this->hasOne(User::class, 'uid', 'uid');
}
public function parent(){
return $this->hasOne(self::class, 'id', 'pid');
}
public function province(){
return $this->hasOne(CityArea::class, 'id', 'province_id');
}
public function city(){
return $this->hasOne(CityArea::class, 'id', 'city_id');
}
public function area(){
return $this->hasOne(CityArea::class, 'id', 'area_id');
}
public function street(){
return $this->hasOne(CityArea::class, 'id', 'street_id');
}
}