mirror of
https://github.com/kongyuebin1/dongfeng-pay.git
synced 2024-12-26 12:12:25 +08:00
13 lines
155 B
Go
13 lines
155 B
Go
|
package utils
|
||
|
|
||
|
/**
|
||
|
** 计算偏移量
|
||
|
*/
|
||
|
func CountOffset(page, limit int) int {
|
||
|
if page > 0 {
|
||
|
return (page - 1) * limit
|
||
|
} else {
|
||
|
return limit
|
||
|
}
|
||
|
}
|