\app\common\libraryhelper

工具类 Class helper

Summary

Methods
Properties
Constants
getArrayColumn()
getArrayColumns()
arrayColumn2Key()
number2()
getArrayItemByColumn()
getArrayColumnSum()
setDataAttribute()
bcsub()
bcadd()
bcmul()
bcdiv()
bccomp()
bcequal()
jsonEncode()
jsonDecode()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getArrayColumn()

getArrayColumn(  $source,   $column) : array

获取数组中指定的列

Parameters

$source
$column

Returns

array

getArrayColumns()

getArrayColumns(  $source,   $columns) : array

获取数组中指定的列

Parameters

$source
$columns

Returns

array

arrayColumn2Key()

arrayColumn2Key(  $source,   $index) : array

把二维数组中某列设置为key返回

Parameters

$source
$index

Returns

array

number2()

number2(  $number,   $isMinimum = false,   $minimum = 0.01) 

Parameters

$number
$isMinimum
$minimum

getArrayItemByColumn()

getArrayItemByColumn(  $array,   $column,   $value) 

Parameters

$array
$column
$value

getArrayColumnSum()

getArrayColumnSum(  $array,   $column) 

Parameters

$array
$column

setDataAttribute()

setDataAttribute(  $source,   $defaultData,   $isArray = false) 

Parameters

$source
$defaultData
$isArray

bcsub()

bcsub(  $leftOperand,   $rightOperand,   $scale = 2) 

Parameters

$leftOperand
$rightOperand
$scale

bcadd()

bcadd(  $leftOperand,   $rightOperand,   $scale = 2) 

Parameters

$leftOperand
$rightOperand
$scale

bcmul()

bcmul(  $leftOperand,   $rightOperand,   $scale = 2) 

Parameters

$leftOperand
$rightOperand
$scale

bcdiv()

bcdiv(  $leftOperand,   $rightOperand,   $scale = 2) 

Parameters

$leftOperand
$rightOperand
$scale

bccomp()

bccomp(  $leftOperand,   $rightOperand,   $scale = 2) 

Parameters

$leftOperand
$rightOperand
$scale

bcequal()

bcequal(  $leftOperand,   $rightOperand,   $scale = 2) 

Parameters

$leftOperand
$rightOperand
$scale

jsonEncode()

jsonEncode(array  $data) : string

数组转义为json

Parameters

array $data

Returns

string

jsonDecode()

jsonDecode(  $json) : array

json转义为数组

Parameters

$json

Returns

array