'游客', (string) self::type_consumer => '普通用户', (string) self::type_business => '商家', (string) self::type_staff => '员工', ]; } public function tag() { return $this->hasOne(Tag::class,"id","tag_id"); } /** * 关联的商户信息 * @return HasOne */ public function business() { return $this->hasOne(Business::class, 'code', 'business_code'); } /** * 关联的上级用户 */ public function parent() { return $this->hasOne(self::class, 'user_code', 'main_code'); } }