淘先锋技术网

首页 1 2 3 4 5 6 7
/**
 * 随机生成抽奖号码
 * @param $integral 积分
 * @param $eliminate 已被抽中号码
 * @return int|mixed
 */
if (!function_exists('luckyDraw')) {
    function luckyDraw($product_integral = 0, $num = 0, $eliminate = [])
    {
        $product_integral = range(10000001, 10000000 + $product_integral);
        $data = array_diff($product_integral, $eliminate);
        shuffle($data);
        return array_slice($data, 0, $num);
    }
}