37 lines
741 B
PHP
37 lines
741 B
PHP
<?php
|
|
|
|
namespace app\model;
|
|
|
|
use think\model\relation\HasOne;
|
|
|
|
class Business extends Base
|
|
{
|
|
const state_reviewing = 0;
|
|
const state_on = 1;
|
|
const state_off = 2;
|
|
|
|
/**
|
|
* @remarks 代理商、平台代理商、渠道商等词组均描述的是平台商,因此文案统一为【平台商】
|
|
*/
|
|
|
|
public function category()
|
|
{
|
|
return $this->hasOne(Category::class, 'id',"type");
|
|
}
|
|
|
|
/**
|
|
* 关联的平台商
|
|
*
|
|
* @return HasOne
|
|
*/
|
|
public function agency(): HasOne
|
|
{
|
|
return $this->hasOne(Business::class, 'agency_code', "code");
|
|
}
|
|
|
|
public function account()
|
|
{
|
|
return $this->hasOne(Account::class, 'business_code',"code");
|
|
}
|
|
}
|