余额变动修改
This commit is contained in:
@@ -56,6 +56,23 @@ class Jk8Services
|
||||
return $result['data']['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户注册
|
||||
* @param int|null $userId
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getAllUsers(int $userId = null): string
|
||||
{
|
||||
$params = $this->createParam('/users/getAllUsers', [
|
||||
'id' => $userId,
|
||||
]);
|
||||
$result = doCurl($this->domain, $params);
|
||||
if (($result['status'] ?? '') === 'ERROR') {
|
||||
throw new Exception($result['data']['message'] ?? 'Remote API Error');
|
||||
}
|
||||
return $result['data']['users'][0]['username'] ?? '';
|
||||
}
|
||||
/**
|
||||
* 获取促销列表
|
||||
* @param string $userId
|
||||
@@ -77,19 +94,21 @@ class Jk8Services
|
||||
/**
|
||||
* 转账
|
||||
* @param string $username
|
||||
* @param float $amount
|
||||
* @return array|mixed|null
|
||||
* @throws Exception
|
||||
*/
|
||||
public function setScore(string $username): mixed
|
||||
public function setScore(string $username, float $amount): mixed
|
||||
{
|
||||
$params = $this->createParam('/member/setScore', [
|
||||
'username' => $username,
|
||||
'amount' => $amount
|
||||
]);
|
||||
$result = doCurl($this->domain, $params);
|
||||
if (($result['status'] ?? '') === 'ERROR') {
|
||||
throw new Exception($result['data']['message'] ?? 'Remote API Error');
|
||||
}
|
||||
return $result;
|
||||
return $result['data']['transactionId'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user