38 lines
714 B
PHP
38 lines
714 B
PHP
<?php
|
|
/**
|
|
* Author: 芸众商城 www.yunzshop.com
|
|
* Date: 2018/11/9
|
|
* Time: 10:13 AM
|
|
*/
|
|
|
|
namespace Yunshop\TeamDividend\models;
|
|
|
|
|
|
use app\common\models\Member;
|
|
use app\common\models\member\ChildrenOfMember;
|
|
|
|
class MemberChild extends ChildrenOfMember
|
|
{
|
|
protected $appends = [
|
|
'directly'
|
|
];
|
|
|
|
public function getDirectlyAttribute()
|
|
{
|
|
$ret = '0';
|
|
if ($this->level == 1) {
|
|
$ret = '1';
|
|
}
|
|
return $ret;
|
|
}
|
|
|
|
public function hasOneTeam()
|
|
{
|
|
return $this->hasOne(TeamDividendAgencyModel::class, 'uid', 'child_id');
|
|
}
|
|
|
|
public function hasOneMember()
|
|
{
|
|
return $this->hasOne(Member::class, 'uid', 'child_id');
|
|
}
|
|
} |