hasOne(User::class, 'user_id', 'user_id'); } public function invitee(): HasOne { return $this->hasOne(User::class, 'user_id', 'invitee_user_id'); } /** * @notes:新增 * @param $data * @return bool * @author: wanghousheng */ public function add($data): bool { $data['store_id'] = self::$storeId; return $this->save($data); } /** * 详情 * @param array $where * @return static|array|null */ public static function detail(array $where) { return self::get($where); } }