rabin 1 year ago
parent
commit
39292ebb8f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Api.php

+ 2 - 2
src/Api.php

@@ -53,7 +53,7 @@ class Api
 	public function setRelation($uid, $parent = false, $code = false)
 	{
 		if ($code) {
-			$parent = $this->getCode($code);
+			$parent = $this->getUid($code);
 		}
 		if ($parent <= 0) {
 			$parent = $this->getSourceUid($uid, false);
@@ -63,7 +63,7 @@ class Api
 		}
 		$relation = new Relation();
 		$relation->set($parent, $uid);
-		return true;
+		return $parent;
 	}
 
 	# 更换上级