Commit 69f0bd63 authored by 杨培's avatar 杨培

增加积分相关接口

parent 82a24101
...@@ -14,6 +14,5 @@ Credit::setDebug(true); ...@@ -14,6 +14,5 @@ Credit::setDebug(true);
//$kk = Credit::updateExp(12, 1, '', 0, '测试加分RuleText', '测试加分Title', '测试加分Memo'); //$kk = Credit::updateExp(12, 1, '', 0, '测试加分RuleText', '测试加分Title', '测试加分Memo');
//$kk = Credit::updateCoin(12, 1, '', 0, '测试加分RuleText', '测试加分Title', '测试加分Memo'); //$kk = Credit::updateCoin(12, 1, '', 0, '测试加分RuleText', '测试加分Title', '测试加分Memo');
$kk = Credit::updateExp(12, 1, 'watch_video', 15, '测试加分RuleText', '测试加分Title', '看视频'); //$kk = Credit::updateExp(12, 1, 'watch_video', 15, '测试加分RuleText', '测试加分Title', '看视频');
Credit::updateCreditByAction('reply', 12);
// \ No newline at end of file
...@@ -13,14 +13,53 @@ use internalApi\base\Client; ...@@ -13,14 +13,53 @@ use internalApi\base\Client;
class Credit extends Client class Credit extends Client
{ {
/**
* 更新扳手币
*
* @param int $ucid 用户中心UID
* @param int $paycredits 扳手币更新数量,正数为加,负数为减
* @param string $operation 操作标识,三位字符串,请在论坛中进行定义,否则保留为空
* @param int $relatedid 对应操作标识的ID
* @param string $ruletxt 提醒文字,默认为空即可
* @param string $customtitle 记录标题
* @param string $custommemo 记录备注
* @return bool
* @throws \internalApi\base\ApiException|\internalApi\base\ClientException
*/
public static function updateCoin($ucid, $paycredits, $operation = '', $relatedid = 0, $ruletxt = '', $customtitle = '', $custommemo = '') public static function updateCoin($ucid, $paycredits, $operation = '', $relatedid = 0, $ruletxt = '', $customtitle = '', $custommemo = '')
{ {
return self::call('credit.updateCoin', compact('ucid', 'paycredits', 'operation', 'relatedid', 'ruletxt', 'customtitle', 'custommemo')); return self::call('credit.updateCoin', compact('ucid', 'paycredits', 'operation', 'relatedid', 'ruletxt', 'customtitle', 'custommemo'));
} }
/**
* 更新扳手值
*
* @param int $ucid 用户中心UID
* @param int $paycredits 扳手值更新数量,正数为加,负数为减
* @param string $operation 操作标识,三位字符串,请在论坛中进行定义,否则保留为空
* @param int $relatedid 对应操作标识的ID
* @param string $ruletxt 提醒文字,默认为空即可
* @param string $customtitle 记录标题
* @param string $custommemo 记录备注
* @return bool
* @throws \internalApi\base\ApiException|\internalApi\base\ClientException
*/
public static function updateExp($ucid, $paycredits, $operation = '', $relatedid = 0, $ruletxt = '', $customtitle = '', $custommemo = '') public static function updateExp($ucid, $paycredits, $operation = '', $relatedid = 0, $ruletxt = '', $customtitle = '', $custommemo = '')
{ {
return self::call('credit.updateExp', compact('ucid', 'paycredits', 'operation', 'relatedid', 'ruletxt', 'customtitle', 'custommemo')); return self::call('credit.updateExp', compact('ucid', 'paycredits', 'operation', 'relatedid', 'ruletxt', 'customtitle', 'custommemo'));
} }
/**
* 执行积分策略
*
* @param string $action 策略标识
* @param int $uid 执行策略的用户
* @return bool
* @throws \internalApi\base\ApiException|\internalApi\base\ClientException
*/
public static function updateCreditByAction($action, $uid)
{
return self::call('credit.updateCreditByAction', ['action'=>$action, 'ucid'=>$uid]);
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment