255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'user_id' => 'User ID', 'avatar' => '头像', 'platform_user_id' => '用户所属平台的用户id', 'integral' => '积分', 'total_integral' => '最高积分', 'balance' => '余额', 'total_balance' => '总余额', 'parent_id' => '上级id', 'is_blacklist' => '是否黑名单', 'contact_way' => '联系方式', 'remark' => '备注', 'is_delete' => 'Is Delete', 'junior_at' => '成为下级时间', 'platform' => '用户所属平台标识', 'temp_parent_id' => '临时上级', 'remark_name' => '备注名', 'pay_password' => '支付密码', ]; } public function getParent() { return $this->hasOne(User::className(), ['id' => 'parent_id']); } public function getFirstChildren() { return $this->hasMany(self::className(), ['parent_id' => 'user_id']); } public function getSecondChildren() { return $this->hasMany(self::className(), ['parent_id' => 'user_id']) ->via('firstChildren'); } public function getThirdChildren() { return $this->hasMany(self::className(), ['parent_id' => 'user_id']) ->via('secondChildren'); } public function getIdentity() { return $this->hasOne(UserIdentity::className(), ['user_id' => 'user_id']); } }