mirror of
https://github.com/kongyuebin1/dongfeng-pay.git
synced 2024-11-23 02:39:26 +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
|
||
|
}
|
||
|
}
|