PHP Class CreditModel, thinksns

Author: jason ([email protected])
Inheritance: extends Model
Show file Open project: medz/thinksns-4 Class Usage Examples

Public Properties

Property Type Description
$creditType
$info 所有设置的值

Public Methods

Method Description
__construct ( ) +---------------------------------------------------------- 架构函数 +----------------------------------------------------------
addTaskCredit ( integer $exp, integer $score, integer $uid ) 添加任务积分
charge_success ( string $serial_number ) 积分充值成功
cleanCache ( $uid ) 清除用户积分缓存
getCreditRuleByName ( $name ) 获取某个系统积分规则
getCreditRules ( ) 获取所有系统积分规则
getCreditType ( ) : array TS2兼容方法:获取积分类型列表
getInfo ( ) 获取积分操作结果
getLevel ( ) : array 获取积分等级规则
getSetData ( ) : array 获取积分设置信息
getTypeList ( ) : [type] 获取积分类型列表
getUserCredit ( integer $uid ) : boolean 获取用户积分
saveCreditLevel ( array $d ) 保存积分等级规则
setUserCredit ( integer $uid, array | string $action, string | integer $type = 1, $des = [] ) : Object TS2兼容方法:设置用户积分 操作用户积分
startTransfer ( array $data = [] ) : boolean 积分转账

Method Details

__construct() public method

+---------------------------------------------------------- 架构函数 +----------------------------------------------------------
Author: melec制作
public __construct ( )

addTaskCredit() public method

添加任务积分
public addTaskCredit ( integer $exp, integer $score, integer $uid )
$exp integer
$score integer
$uid integer

charge_success() public method

积分充值成功
public charge_success ( string $serial_number )
$serial_number string 订单号

cleanCache() public method

清除用户积分缓存
public cleanCache ( $uid )

getCreditRuleByName() public method

获取某个系统积分规则
public getCreditRuleByName ( $name )

getCreditRules() public method

获取所有系统积分规则
public getCreditRules ( )

getCreditType() public method

TS2兼容方法:获取积分类型列表
public getCreditType ( ) : array
return array 积分类型列表

getInfo() public method

return string
public getInfo ( )

getLevel() public method

获取积分等级规则
public getLevel ( ) : array
return array 积分等级规则信息

getSetData() public method

获取积分设置信息
public getSetData ( ) : array
return array 积分设置信息

getTypeList() public method

获取积分类型列表
public getTypeList ( ) : [type]
return [type]

getUserCredit() public method

返回积分值的数据结构 array( 'score' =>array( 'credit'=>'1', 'alias' =>'积分', ), 'experience'=>array( 'credit'=>'2', 'alias' =>'经验', ), '类型' =>array( 'credit'=>'值', 'alias' =>'名称', ), )
public getUserCredit ( integer $uid ) : boolean
$uid integer
return boolean array

saveCreditLevel() public method

保存积分等级规则
public saveCreditLevel ( array $d )
$d array 修改的积分等级规则

setUserCredit() public method

TS2兼容方法:设置用户积分 操作用户积分
public setUserCredit ( integer $uid, array | string $action, string | integer $type = 1, $des = [] ) : Object
$uid integer 用户ID
$action array | string 系统设定的积分规则的名称 或临时定义的一个积分规则数组,例如array('score'=>-4,'experience'=>3)即socre减4点,experience加三点
$type string | integer reset:按照操作的值直接重设积分值,整型:作为操作的系数,-1可实现增减倒置
return Object

startTransfer() public method

积分转账
public startTransfer ( array $data = [] ) : boolean
$data array 转账数据
return boolean

Property Details

$creditType public property

public $creditType

$info public property

所有设置的值
public $info