一、详细介绍

全新三网话费余额查询API系统源码 thinkphp全开源 附教程

本套系统是用thinkphp6.0框架开发的,PHP版本需8.1以上,可查询手机号话费余额、归属地和运营商等信息,系统支持用户中心在线查询和通过API接口对接发起查询,用户余额充值是对接usdt接口或者通过后台生成卡密,源码全开源,支持懂技术的人二次开发~

二、效果展示

1.部分代码

代码如下(示例):

/**
 * 根据Time获取时间
 * @param string $time 时间 列:-1(则为前一天)
 * @return string
 */
function Times(string $time): string
{
    return date('Y-m-d', strtotime($time . 'day'));
}

/**
 * 根据Sms_data获取用户产品数量统计
 * @param string $type 获取分类
 * @param string $time 时间 列:-1(则为前一天)
 * @param string $times
 * @param int|null $uid
 * @return string
 */
function query_data(string $type, string $time, string $times, int $uid = null): string
{
    $time = date('Y-m-d', strtotime($time . 'day'));
    $times = date('Y-m-d', strtotime($times . 'day'));
    
    $par[] = ['uid', '=', $uid];
    $par[] = ['channel', '=', $type];
    $par[] = ['create_time', 'between', [$time, $times]];
    
    $statistics = QueryRecord::where($par)->count();
    return $statistics;
}



function admin_index(string|int $uid, string $channel, string $time): string
{
    if(!empty($uid)){
        $par[] = ['uid', '=', $uid];
    }
    $par[] = ['channel', '=', $channel];

    if($channel === 'unicom_record'){
        if($time === 'jr'){
            $query_data = QueryRecord::where($par)->whereDay('create_time', date('Y-m-d'))->count();
        }
        if($time === 'zr'){
            $query_data = QueryRecord::where($par)->whereDay('create_time', date('Y-m-d',strtotime(-1 . 'day')))->count();
        }
        if($time === 'qb'){
            $query_data = QueryRecord::where($par)->count();
        }
    }
    if($channel === 'unicom_balance'){
        if($time === 'jr'){
            $query_data = QueryRecord::where($par)->whereDay('create_time', date('Y-m-d'))->count();
        }
        if($time === 'zr'){
            $query_data = QueryRecord::where($par)->whereDay('create_time', date('Y-m-d',strtotime(-1 . 'day')))->count();
        }
        if($time === 'qb'){
            $query_data = QueryRecord::where($par)->count();
        }
    }
    if($channel === 'telecom_balance'){
        if($time === 'jr'){
            $query_data = QueryRecord::where($par)->whereDay('create_time', date('Y-m-d'))->count();
        }
        if($time === 'zr'){
            $query_data = QueryRecord::where($par)->whereDay('create_time', date('Y-m-d',strtotime(-1 . 'day')))->count();
        }
        if($time === 'qb'){
            $query_data = QueryRecord::where($par)->count();
        }
    }
    if($channel === 'mobile_balance'){
        if($time === 'jr'){
            $query_data = QueryRecord::where($par)->whereDay('create_time', date('Y-m-d'))->count();
        }
        if($time === 'zr'){
            $query_data = QueryRecord::where($par)->whereDay('create_time', date('Y-m-d',strtotime(-1 . 'day')))->count();
        }
        if($time === 'qb'){
            $query_data = QueryRecord::where($par)->count();
        }
    }
    if($channel === 'detection_mnp'){
        if($time === 'jr'){
            $query_data = QueryRecord::where($par)->whereDay('create_time', date('Y-m-d'))->count();
        }
        if($time === 'zr'){
            $query_data = QueryRecord::where($par)->whereDay('create_time', date('Y-m-d',strtotime(-1 . 'day')))->count();
        }
        if($time === 'qb'){
            $query_data = QueryRecord::where($par)->count();
        }
    }
    return $query_data;
}

2.效果图展示

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述


三、学习资料下载

百度云:https://pan.baidu.com/s/1GzVI5BYGK9DM_8YWvq8RPg?pwd=x5gt

Logo

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。

更多推荐