Compare commits

...

79 Commits

Author SHA1 Message Date
“wanyongkang”
c80725bb4a 代理商下用户注册检验是否存在 2026-04-13 12:45:13 +08:00
“wanyongkang”
2efa163483 客户通过代理商api注册 2026-04-11 13:28:24 +08:00
“wanyongkang”
abb3584262 添加代理商注册用户接口 2026-04-08 15:35:17 +08:00
5a1d44095c 金柚所有未过期账号都不允许重复 2026-02-12 16:49:58 +08:00
2649b20dae 修复订单接口请求格式问题 2025-10-21 14:12:28 +08:00
aea1718fd0 新增短效无限量白名单接口功能 2025-10-18 20:22:24 +08:00
79641f01ee 新增本地开发环境配置 2025-10-18 11:32:27 +08:00
“wanyongkang”
cbf3c44f14 修改呼叫号码 2025-06-18 09:46:33 +08:00
“wanyongkang”
79b0c7cf1c 修改续费api 2025-06-16 18:16:30 +08:00
“wanyongkang”
4dabfb1e4d 拨号 2025-06-16 17:02:47 +08:00
“wanyongkang”
9f0684addc 修改拨号号码 2025-06-16 16:51:47 +08:00
“wanyongkang”
4fd76358f2 【代理商明细显示错误】
https://www.tapd.cn/tapd_fe/67163502/bug/detail/1167163502001000048
2025-06-16 14:35:33 +08:00
“wanyongkang”
6d96f15f95 销售信息 2025-06-13 15:20:19 +08:00
“wanyongkang”
28f4dcce32 批量修改密码 以及销售信息修改 2025-06-13 15:10:26 +08:00
“wanyongkang”
392b680e75 修改bug 价格有误 2025-05-30 19:43:25 +08:00
“wanyongkang”
48856a4d0e 修改2 2025-05-30 15:34:51 +08:00
“wanyongkang”
c324ca598a 修改客户价格超过划线价 2025-05-30 15:20:27 +08:00
“wanyongkang”
8092eea21c 修改显示解除标识 2025-05-28 16:45:45 +08:00
“wanyongkang”
246a83bac4 水滴设置价格可以高过官网价 2025-05-28 14:30:42 +08:00
“wanyongkang”
272d5e6132 金柚修改限制标记 2025-05-28 10:50:05 +08:00
“wanyongkang”
24a9b4a960 添加解除限制的标记 2025-05-28 10:24:43 +08:00
“wanyongkang”
1a4dbef678 修改为同时间可查 2025-05-27 18:03:44 +08:00
“wanyongkang”
02c7af374b 【代理商管理页面可通过代理商账号和手机号都能搜索】
https://www.tapd.cn/tapd_fe/67163502/story/detail/1167163502001000055
2025-05-27 17:38:58 +08:00
“wanyongkang”
853e9d4855 修改删除账号的判断条件 2025-05-23 15:08:20 +08:00
“wanyongkang”
9695c0114a 添加解除屏蔽接口 2025-05-23 14:43:30 +08:00
“wanyongkang”
bbf663365d 修改跟进记录显示状态 2025-05-17 11:49:43 +08:00
“wanyongkang”
73bce4e8f8 修改客户维护的数据显示 2025-05-17 11:37:18 +08:00
“wanyongkang”
e81e23e0f1 添加ip查询接口 2025-05-16 18:29:01 +08:00
“wanyongkang”
2eae6b28f3 修改3 2025-05-15 23:04:14 +08:00
“wanyongkang”
e44720fee6 修改2 2025-05-15 23:02:34 +08:00
“wanyongkang”
3fd9a6ccba 修改 2025-05-15 22:56:10 +08:00
“wanyongkang”
f537e28f8f 批量判断 2025-05-15 22:47:15 +08:00
“wanyongkang”
784a3edb48 监测账号是否存在 2025-05-15 22:38:25 +08:00
“wanyongkang”
cf3a44235e 为用户单独设置删除账号接口 2025-05-15 16:35:34 +08:00
“wanyongkang”
3d5da26120 添加删除接口 2025-05-15 14:01:10 +08:00
“wanyongkang”
d5efeb8683 修改代理商接口 2025-05-14 09:30:08 +08:00
“wanyongkang”
df98653c2c 修改续费接口 2025-05-12 14:13:36 +08:00
“wanyongkang”
b788c754f5 修改模板 2025-04-29 16:45:24 +08:00
“wanyongkang”
1c9685eb89 修改短信模板 2025-04-29 15:30:35 +08:00
“wanyongkang”
20dfffd542 修改代理退款接口 2025-04-27 14:31:44 +08:00
“wanyongkang”
0a2600f9a6 猎豹解除屏蔽 2025-04-24 10:15:07 +08:00
“wanyongkang”
c53518b1d1 修改猎豹服务器列表 2025-04-19 17:40:10 +08:00
“wanyongkang”
b3c2ad57a8 修改跟进显示 2025-04-14 17:40:36 +08:00
“wanyongkang”
4ae6a941cc 代理商发送短信 2025-04-14 15:59:13 +08:00
“wanyongkang”
2afea875ae 水滴返款 -修复bug 2025-04-03 14:46:14 +08:00
“wanyongkang”
90f7352d9c 水滴-代理返款2 2025-04-02 16:28:18 +08:00
“wanyongkang”
153b8a84c3 水滴-代理返款 2025-04-02 16:12:33 +08:00
“wanyongkang”
4f4533e119 设置过期账号删除 2025-03-25 17:20:59 +08:00
“wanyongkang”
36be468ac6 提现 2025-02-14 15:16:25 +08:00
“wanyongkang”
f0fe92ae20 修改提现 2025-02-14 15:15:15 +08:00
“wanyongkang”
e16e872a3a 修改回华连支付宝 2025-02-08 18:15:16 +08:00
“wanyongkang”
4e1e007ef7 限制ip 2025-02-05 15:47:01 +08:00
“wanyongkang”
4e955619a9 解除ip限制 2025-01-25 15:20:12 +08:00
“wanyongkang”
c9603421e4 修改支付宝api 2025-01-23 15:48:26 +08:00
“wanyongkang”
7335d85062 限制ip 2025-01-07 16:21:46 +08:00
“wanyongkang”
45cc448c1f php 不限制IP 2024-12-12 16:25:31 +08:00
“wanyongkang”
f04273024c 跟进记录 添加极光 2024-12-02 17:21:58 +08:00
“wanyongkang”
b9bd680fb1 添加退款接口 2024-12-02 15:02:24 +08:00
“wanyongkang”
e77389d7a0 添加极光腾讯限制 2024-11-08 17:43:08 +08:00
“wanyongkang”
9e03ee42b6 极光ip线路 2024-11-07 15:23:36 +08:00
“wanyongkang”
e24f39e116 跟进记录 2024-10-14 17:54:47 +08:00
“wanyongkang”
21e6268008 跟进记录 2024-10-14 17:51:34 +08:00
“wanyongkang”
27241d8d81 添加蘑菇解除限制 2024-10-14 10:47:55 +08:00
“wanyongkang”
e7d6e69d75 拨号 2024-10-10 15:17:23 +08:00
“wanyongkang”
0c3cad4a6d 修改拨号 2024-10-10 15:05:42 +08:00
“wanyongkang”
36939effe3 修改实名认证逻辑 2024-10-09 16:22:52 +08:00
“wanyongkang”
37b7ac4c49 修改电话维护的电话对应 2024-10-09 15:22:21 +08:00
“wanyongkang”
db9b9726eb 将改im修改为get 2024-09-30 14:32:34 +08:00
“wanyongkang”
900c68f02d 修改蘑菇的解除限制 2024-09-28 13:59:20 +08:00
“wanyongkang”
4db772e33b 认证信息 2024-08-05 17:10:35 +08:00
“wanyongkang”
1d562202d6 获取实名信息 2024-08-05 10:17:35 +08:00
“wanyongkang”
0b3209843b 极狐领取订单 2024-07-15 18:03:00 +08:00
“wanyongkang”
20abe2f569 1 2024-07-09 16:01:44 +08:00
“wanyongkang”
55156b50a2 请求开通im 2024-07-09 16:00:29 +08:00
“wanyongkang”
c8bfcceeba 接触蘑菇极狐im 2024-07-09 15:47:04 +08:00
“wanyongkang”
e1959e1225 处理金柚超时请求 2024-07-02 18:41:04 +08:00
“wanyongkang”
4ad116651b 校卫科技 2024-06-29 10:30:00 +08:00
“wanyongkang”
5fa8327363 极狐服务器列表 2024-06-21 17:20:57 +08:00
“wanyongkang”
c05fd8568b 代理商实名 2024-05-30 15:18:20 +08:00
36 changed files with 1650 additions and 363 deletions

6
.gitignore vendored
View File

@@ -1 +1,5 @@
*.csv
*.csv
.idea/
.vscode/
.volumes/

3
Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM php:7.3-fpm-alpine
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN docker-php-ext-install pdo_mysql mysqli

View File

@@ -24,8 +24,9 @@ class Agent extends Controller
}
$where = [];
if(!empty($_GET['keyWord'])){
$where['username'] = $_GET['keyWord'];
$where = "username ='".$_GET['keyWord']."' OR phone='".$_GET['keyWord']."'";
}
$agent_user_model = new AgentUser;
$user_model = new UserModel;
$order_model = new ProductOrderModel;

View File

@@ -11,6 +11,9 @@ use extend\redis\Redisop;
use app\tencent\model\Agreement as AgreementModel;
use Qiniu\Auth;
use Qiniu\Storage\UploadManager;
use Jdcloud\Credentials\Credentials;
use Jdcloud\Result;
use Jdcloud\Cloudauth\CloudauthClient;
class Index
{
@@ -68,11 +71,19 @@ class Index
$user_model = new UserModel();
$is_exit = $user_model->getOne(['Phone' => $phone]);
if($is_exit) {
$return_data = [
'code' => 0,
'msg' => '用户已经存在'
];
echo json_encode($return_data);die;
if ($is_exit['is_verify'] == 0) {
$data_user_old = [
'LoginCode' => $is_exit['LoginCode'].'-del',
'Phone' => $is_exit['Phone'].'-del',
];
$user_model->updateOne(['Id'=>$is_exit['Id']],$data_user_old);
}
// $return_data = [
// 'code' => 0,
// 'msg' => '用户已经存在'
// ];
// echo json_encode($return_data);die;
}
@@ -162,16 +173,25 @@ class Index
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
if ($has_user){
$info = [
'Code' => 20000,
'Data' => '',
'Message' => '该账号或者手机号被注册了',
];
echo json_encode($info);
die;
if ($has_user['is_verify'] == 0) {
$data_user_old = [
'LoginCode' => $has_user['LoginCode'].'-del',
'Phone' => $has_user['Phone'].'-del',
];
$user_model->updateOne(['Id'=>$has_user['Id']],$data_user_old);
}
// $info = [
// 'Code' => 20000,
// 'Data' => '',
// 'Message' => '该账号或者手机号被注册了',
// ];
// echo json_encode($info);
// die;
}
$has_user2 = $user_model->isExit("id_code='".$data['id_code']."' and is_verify=1'");
$has_user2 = $user_model->isExit("id_code='".$data['id_code']."' and is_verify=1");
if ($has_user2){
$info = [
'Code' => 30000,
@@ -194,6 +214,105 @@ class Index
die;
}
//推广用户注册
public function apiregister()
{
$data = $_GET;
// dump($data);die;
unset($data['s']);
$data['LoginCode'] = trim($data['LoginCode']);
if(empty($data['LoginCode'])){
$info = [
'Code' => 10003,
'Data' => '',
'Message' => '账号为空',
];
echo json_encode($info);
die;
}
//----
if(empty($data['agent_id'])){
$info = [
'Code' => 10003,
'Data' => '',
'Message' => '代理id错误',
];
echo json_encode($info);
die;
}
$data['agent_id'] = base64_decode($data['agent_id']);
if ($data['agent_id']<10000) {
$info = [
'Code' => 10003,
'Data' => '',
'Message' => '代理id错误',
];
echo json_encode($info);
die;
}
// dump($data);die;
$data['Phone'] = $data['LoginCode'];
$data['TenantId'] = 0;
$data['Enabled'] = 1;
$data['UpdateTime'] = date('Y-m-d H:i:s',time());
$data['CreateTime'] = date('Y-m-d H:i:s',time());
$data['CreateType'] = 4;
$data['ProductAccountCount'] = 0;
$data['ExpiredProductAccountCount'] = 0;
$data['RestAmount'] = 0;
$data['ConsumeAmount'] = 0;
$data['DeleteTag'] = 0;
$data['UseTestCount'] = 0;
$data['Sex'] = 0;
$data['Wx'] = '';
$data['QQ'] = '';
$data['LastLoginDate'] = date('Y-m-d H:i:s',time());
$data['Password'] = empty($data['Password'])?cToMd5('123568'):cToMd5(trim($data['Password']));
$user_model = new UserModel;
$data['ManagerId'] = 0;
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
if ($has_user){
if ($has_user['is_verify'] == 0) {
$data_user_old = [
'LoginCode' => $has_user['LoginCode'].'-del',
'Phone' => $has_user['Phone'].'-del',
];
$user_model->updateOne(['Id'=>$has_user['Id']],$data_user_old);
} else {
$info = [
'Code' => 20000,
'Data' => '',
'Message' => '该账号或者手机号被注册了',
];
echo json_encode($info);
die;
}
}
if ($user_model->add($data)) {
$info = [
'Code' => 10000,
'Data' => '',
'Message' => '该账号注册成功!',
];
echo json_encode($info);
die;
}
die;
}
private function getCred(){
$ak = "JDC_A3B38E573D7404F976472FB42F52";
$sk = "C9BAE98F49B42DA2DC02868A75AA3AD8";
@@ -237,6 +356,25 @@ class Index
return $data;
}
public function getisverify()
{
$user_phone = $_GET['user'];
$user = new UserModel;
$user_one_info = $user->getOne(['LoginCode'=>$user_phone]);
if($user_one_info['is_verify'] == 1){
$data = [
'Code'=>10000
];
echo json_encode($data);
die;
} else {
$data = [
'Code'=>-10000
];
}
echo json_encode($data);
}
public function aliGetResult()
{
$user_phone = $_GET['user'];

View File

@@ -59,6 +59,10 @@ class Score extends Controller
$id = $agent_user_model->getOne(['username'=>$get_data['keyWord']])['id'];
$where['agent_id'] = $id;
}
if(!empty($get_data['id'])){
$where['agent_id'] = $get_data['id'];
}
if (!empty($_GET['Btime'])){
$date1 = date('Y-m-d', strtotime($_GET['Btime']));

View File

@@ -10,9 +10,26 @@ class Account
public function __construct ()
{
error_reporting(0);
ini_set('display_errors', 0);
if(empty($_GET['apikey'])){
die;
}
$data = $_GET;
$apikey = $data['apikey'];
$user_model = new User;
$user_info = $user_model->getOne(['apikey'=>$apikey]);
if (empty($user_info)){
$return_data = [
'Code' => 0,
'Message' => 'apikey不符合规范',
];
echo json_encode($return_data);
die;
}
}
//查询账号信息 ?apikey=1232455165&product=5&account=test1231
public function queryAccount()
@@ -42,6 +59,45 @@ class Account
];
echo json_encode($return_data);
}
public function acctExist()
{
//获取传递的数据
$data = $_GET;
$apikey = $data['apikey'];
$user_model = new User;
$user_info = $user_model->getOne(['apikey'=>$apikey]);
if (empty($user_info)){
$return_data = [
'Code' => 0,
'Message' => 'apikey不符合规范',
];
echo json_encode($return_data);
die;
}
$up_data = [$data['account']];
if (strstr($data['account'], ',')) {
$up_data = explode(",", $data['account']);
}
$account_model = new ProductAccount;
$info = $account_model->getOne(['Account'=>["IN",$up_data]],'ProductName,PackageName,Account,ConnectCount,StartTime,EndTime');
if ($info) {
$return_data = [
'Code' => 0,
'Data' => $info,
'Message' => '账户已存在',
];
echo json_encode($return_data);
} else {
$return_data = [
'Code' => 10000,
'Message' => '账户不存在',
];
echo json_encode($return_data);
}
}
//通过接口开测试
// /api/account/creeatTest?apikey=1232455165&product=5&package=61&account=test1231&pwd=123
public function createTest()
@@ -84,6 +140,31 @@ class Account
$data = $_GET;
$url = 'https://juip.com/product/ApiCreateOrder';
if ((strpos($data['account'], ',') !== false || strpos($data['account'], '、') !== false || strpos($data['account'], '') !== false)) {
$data = [
'Code' => 0,
'Message' => '请操作单个账户',
];
echo json_encode($data);
die;
}
if ($data['type'] == 3) {
$account_model = new ProductAccount;
$info = $account_model->getOne(['Account'=>$data['account'],"DeleteTag" => 0],'ProductName,PackageName,Account,ConnectCount,StartTime,EndTime');
if ($data['connect'] != $info['ConnectCount']) {
$data = [
'Code' => 0,
'Message' => '连接数不正确,请核对后重新请求',
];
echo json_encode($data);
die;
}
}
$params = array(
"apikey" => $data['apikey'],
"PackageId" => $data['package'],
@@ -207,4 +288,105 @@ class Account
echo $result;
}
//退款
public function refund()
{
//获取传递的数据
$data = $_GET;
$url = 'http://localhost:5000/api/course/v1/order/ApiRefund';
$params = array(
"apikey" => $data['apikey'],
"Account" => $data['account']
);
$data_string = json_encode($params);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$result = curl_exec($ch);
echo $result;
}
//退款
public function deleteAcct()
{
$data = $_GET;
$apikey = $data['apikey'];
$user_model = new User;
$user_info = $user_model->getOne(['apikey'=>$apikey]);
$account_model = new ProductAccount;
if ($user_info['Id'] != 163642) {
die;
}
$where = [
'UserId' => $user_info['Id'],
'account' => $data['account'],
'DeleteTag' => 0
];
$account_info = $account_model->getOne($where);
$update_data['DeleteTag'] = 1;
if ($account_info['ProductId'] == 29) {
$url = "http://124.236.113.166:18702/api/agent/deleteAcct/apikey/80cf4f64e990b78a9fc5eb/account/".$account_info['Account'];
linkcurl($url,'GET',[],[],0);
} elseif ($account_info['ProductId'] == 3 || $account_info['ProductId'] == 26) {
$url = "http://106.119.166.87:18702/api/agent/deleteAcct/apikey/80cf4f64e990b78a9fc5eb/account/".$account_info['Account'];
linkcurl($url,'GET',[],[],0);
}
$account_model->updateOne($where,$update_data);
echo json_encode(['Code'=>10000,'Message' => '删除成功']);
}
//解除账号限制
public function openlimit() {
$data = $_GET;
if(!$data){
die;
}
$data = $_GET;
$apikey = $data['apikey'];
$user_model = new User;
$user_info = $user_model->getOne(['apikey'=>$apikey]);
$account_model = new ProductAccount;
$where = [
'UserId' => $user_info['Id'],
'account' => $data['account'],
'DeleteTag' => 0
];
$account_info = $account_model->getOne($where);
if ($account_info) {
// dump($data);die;
if ($data['productId'] == 18) {
$url = "http://rds-api.juip.com/api/agent/openIM/account/".$data['account'];
} elseif ($data['productId'] == 29) {
$url = "http://124.236.113.166:18702/api/agent/openIM/apikey/80cf4f64e990b78a9fc5eb/account/".$data['account'];
} elseif ($data['productId'] == 3 || $data['productId'] == 26) {
$url = "http://106.119.166.87:18702/api/agent/openIM/apikey/80cf4f64e990b78a9fc5eb/account/".$data['account'];
}
linkcurl($url,'GET',[],[],0);
echo json_encode(['Code'=>10000,'Message' => '解除成功']);
} else {
echo json_encode(['Code'=>-10000,'Message' => '账号不存在']);
}
}
}

View File

@@ -36,4 +36,17 @@ class Index extends Controller
];
echo json_encode($data);
}
public function getIpAddress()
{
if(!$_GET){
die;
}
$ip = $_GET['ip'];
$cip_content = json_decode(file_get_contents('https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?co=&resource_id=6006&oe=utf8&query='.$ip),true);
\result($cip_content['data'][0]['location']);
}
}

View File

@@ -3,6 +3,7 @@
namespace app\api\controller;
use app\api\model\BrowserVerify;
use app\api\model\User;
class Verify
{
@@ -21,4 +22,60 @@ class Verify
result([], 'false', 30000);
}
}
//验证用户是否实名
public function userverify() {
$post = $_POST;
if (empty($post)) {
$post = json_decode(file_get_contents("php://input"), true);
}
$username = $post['phone'];
if (empty($username)) {
$return_data = [
'code' => -1,
'msg' => '身份证号或手机号不能为空',
];
echo json_encode($return_data);
die;
}
$user_model = new User;
$userinfo = $user_model->getOne(['LoginCode'=>$username], 'is_verify');
if ($userinfo['is_verify']) {
$return_data = [
'code' => 1,
'msg' => '实名认证成功',
];
echo json_encode($return_data);
die;
} else {
$return_data = [
'code' => -1,
'msg' => '实名认证失败',
];
echo json_encode($return_data);
die;
}
}
public function openlimit() {
$data = $_POST;
if (empty($data)) {
$data = json_decode(file_get_contents("php://input"), true);
}
if (empty($data)) {
$data = $_GET;
}
$url = "http://124.236.113.166:18702/api/agent/openIM/apikey/80cf4f64e990b78a9fc5eb/account/".$data['account'];
linkcurl($url,'GET',[],[],0);
echo json_encode(['code'=>1,]);
}
}

View File

@@ -11,6 +11,9 @@ use app\jinyou\model\Account as AccountModel;
use app\jinyou\model\Package as PackageModel;
use app\jinqiao\model\Order as JqOrderModel;
use app\jinqiao\model\Key as KeyModel;
use app\agent\model\AgentUser as AgentModel;
use app\agent\model\ProductPriceScheme;
use app\agent\model\AgentScore as AgentScoreModel;
class Alipay {
@@ -161,6 +164,58 @@ class Alipay {
$package_info['ProductName'] = $order_info['ProductName'];
$account_model->open_account($account_info,$user_info,$package_info);
}
//代理计算
if($order_info['agent_id'] != 0 && $order_info['PaymentAmount'] != 0.1){
$agent_model = new AgentModel();
$agent_info = $agent_model->getOne(['id' => $order_info['agent_id']]);
//根据折扣设置价格
$score_money = 0.00;
if($agent_info['discount_id'] != 0){
$scheme_model = new ProductPriceScheme();
//获取代理折扣
$discount = $scheme_model->getOne(['Id' => $agent_info['discount_id']]);
$price = $package_info['LinePrice'] * $discount['discount'] / 100;
if ($price < $package_info['MinPrice']) {
$price = $package_info['MinPrice'];
}
$score_money = $order_info['PaymentAmount'] - $order_info['ConnectCount'] * $order_info['AccountCount'] * $price;
}
$score_model = new AgentScoreModel();
$score_data = [
'agent_id' => $order_info['agent_id'],
'order_id' => $order_info['Id'],
'score_type' => 1,
'score_value' => $score_money,
'remark' => "客户购买产品".$order_info['Accounts'],
'agent_name' => $agent_info['username'],
'op_user' => $order_info['UserName'],
'rest_amount1' => $agent_info['account'],
'rest_amount2' => $agent_info['account'] + $score_money
];
$agent_data = ['account' => ($agent_info['account'] + $score_money)];
$score_model->add($score_data);
$agent_model->updateOne(['id' => $order_info['agent_id']],$agent_data);
}
}
}

View File

@@ -10,6 +10,9 @@ use app\jinyou\model\Account as AccountModel;
use app\jinyou\model\Package as PackageModel;
use app\jinqiao\model\Order as JqOrderModel;
use app\jinqiao\model\Key as KeyModel;
use app\agent\model\AgentUser as AgentModel;
use app\agent\model\ProductPriceScheme;
use app\agent\model\AgentScore as AgentScoreModel;
class Wxpay {
@@ -144,6 +147,53 @@ class Wxpay {
$account_model = new AccountModel;
$account_model->open_account($account_info,$user_info,$package_info);
//代理计算
if($order_info['agent_id'] != 0 && $order_info['PaymentAmount'] != 0.1){
$agent_model = new AgentModel();
$agent_info = $agent_model->getOne(['id' => $order_info['agent_id']]);
//根据折扣设置价格
$score_money = 0.00;
if($agent_info['discount_id'] != 0){
$scheme_model = new ProductPriceScheme();
//获取代理折扣
$discount = $scheme_model->getOne(['Id' => $agent_info['discount_id']]);
$price = $package_info['LinePrice'] * $discount['discount'] / 100;
if ($price < $package_info['MinPrice']) {
$price = $package_info['MinPrice'];
}
$score_money = $order_info['PaymentAmount'] - $order_info['ConnectCount'] * $order_info['AccountCount'] * $price;
}
$score_model = new AgentScoreModel();
$score_data = [
'agent_id' => $order_info['agent_id'],
'order_id' => $order_info['Id'],
'score_type' => 1,
'score_value' => $score_money,
'remark' => "客户购买产品".$order_info['Accounts'],
'agent_name' => $agent_info['username'],
'op_user' => $order_info['UserName'],
'rest_amount1' => $agent_info['account'],
'rest_amount2' => $agent_info['account'] + $score_money
];
$agent_data = ['account' => ($agent_info['account'] + $score_money)];
$score_model->add($score_data);
$agent_model->updateOne(['id' => $order_info['agent_id']],$agent_data);
}
//处理完成之后,告诉微信成功结果
echo '<xml>

View File

@@ -308,7 +308,48 @@ class Order extends Controller
switch ($data['order_type']) {
case 2:
$data['money'] = round($data['data']['periodAmount'] * $price['price'],2);
$peroid = $data['data']['periodAmount'];
$whitelist = 0;
if (isset($data['renew'])) {
$url = $this->url_root . '/user/short/unlimited/whitelist/maxAmount';
$req = formatHttpRequert([
'sgUserId' => $this->http_user_info['sgUserId'],
]);
$resp = json_decode(linkcurl($url, 'POST', $req, [], 0));
if ($resp->s < 0) {
return [
'code'=>-1,
'data' => $resp,
'msg' => '请求后台失败,请联系客服!'
];
}
$whitelist = $resp->d->maxAmount;
}
else {
if (!isset($data['data']['maxWhitelist'])) {
return [
'code'=>-2,
'data' => '',
'msg' => '请求后台失败,请联系客服!'
];
}
$whitelist = $data['data']['maxWhitelist'];
}
if ($whitelist == 0) {
return [
'code'=>-3,
'data' => '',
'msg' => '请求后台失败,请联系客服!'
];
}
$discount = max(.6, 1 - .1 * ($whitelist -1)); // 每多一个白名单配额就减 1 折,最低 6 折
$data['money'] = round($price['price'] * $peroid * $whitelist * $discount, 2);
break;
case 3:
$data['money'] = round(($data['data']['periodAmount'] * $price['price'] * $data['data']['ipAmount']),2);
@@ -342,13 +383,22 @@ class Order extends Controller
if ($order_model->add($order_data)) {
$url = $http_url;
$request_data = formatHttpRequert($request_data);
if ($url == $this->url_root . '/user/pack/renew') {
$request_data = [
'sgUserId' => $request_data['sgUserId'],
'packId' => $request_data['packId'],
'packType' => $request_data['packType'],
'periodType' => $request_data['periodType'],
'periodAmount' => $request_data['periodAmount'],
];
}
$request_data = formatHttpRequert($request_data);
$http_data = json_decode(linkcurl($url,'POST',$request_data,[],0));
if ($http_data->s < 0) {
$info = [
'code'=>-1,
'code'=>-7,
'data' => '非法参数',
'msg' => '请求后台失败,请联系客服!'
];
@@ -369,7 +419,7 @@ class Order extends Controller
if ($http_order_data->s < 0) {
$info = [
'code'=>-1,
'code'=>-8,
'data' => '非法参数',
'msg' => '请求后台失败,请联系客服!'
];
@@ -393,7 +443,7 @@ class Order extends Controller
}
} else {
$info = [
'code'=>-1,
'code'=>-6,
'data' => '非法参数',
'msg' => '请求后台失败,请联系客服!'
];
@@ -402,7 +452,7 @@ class Order extends Controller
}
} else {
$info = [
'code'=>-1,
'code'=>-5,
'data' => '非法参数',
'msg' => '聚币不足!'
];
@@ -411,7 +461,7 @@ class Order extends Controller
} else {
$info = [
'code'=>-1,
'code'=>-4,
'data' => '非法参数',
'msg' => '聚币不足!'
];

View File

@@ -8,16 +8,14 @@ use app\http\model\Order as OrderModel;
use enum\http\Order as HttpOrderEnum;
use app\http\model\Recharge as RechargeModel;
class User extends Controller
{
class User extends Controller {
// private $url_root = 'https://sandbox.sgxz.cn';
private $url_root = 'https://merchant.sgxz.cn';
private $http_user_info = [];
public function __construct()
{
parent::__construct('','');
public function __construct() {
parent::__construct('', '');
if (empty($this->userinfo['UserId'])) {
die;
}
@@ -31,12 +29,12 @@ class User extends Controller
$request_data = [
'sgUserId' => $this->http_user_info['sgUserId'],
];
$url = $this->url_root.'/user/detail';
$url = $this->url_root . '/user/detail';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$user_data = [
'uid' => $this->http_user_info['sgUserId'],
'token' => $data->d->apiToken,
@@ -74,7 +72,7 @@ class User extends Controller
foreach ($list as &$info) {
$info['pay_type'] = $pay_type[$info['pay_type']];
}
echo json_encode($list);
}
@@ -83,21 +81,21 @@ class User extends Controller
$request_data = [
'sgUserId' => $this->http_user_info['sgUserId'],
];
$url = $this->url_root.'/user/short/pack/list';
$url = $this->url_root . '/user/short/pack/list';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$list = array_merge($data->d->packs->period,$data->d->packs->unlimited,$data->d->packs->usage);
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$list = array_merge($data->d->packs->period, $data->d->packs->unlimited, $data->d->packs->usage);
foreach ($list as &$info) {
$info->name = HttpOrderEnum::$package_type[ $info->planType];
$info->name = HttpOrderEnum::$package_type[$info->planType];
$info->durationType2 = $info->durationType;
$info->durationType = HttpOrderEnum::$durationType[ $info->durationType];
$info->expireTime = date('Y-m-d H:i:s',$info->expireTime);
$info->isExpired = $info->isExpired?'已过期':'未过期';
$info->ipAmount = $info->ipAmount?:'无限量';
$info->remainingAmount = $info->remainingAmount?:'无限量';
$info->durationType = HttpOrderEnum::$durationType[$info->durationType];
$info->expireTime = date('Y-m-d H:i:s', $info->expireTime);
$info->isExpired = $info->isExpired ? '已过期' : '未过期';
$info->ipAmount = $info->ipAmount ?: '无限量';
$info->remainingAmount = $info->remainingAmount ?: '无限量';
}
$return_data = [
@@ -107,23 +105,22 @@ class User extends Controller
];
echo json_encode($return_data);
}
//短效全部套餐
public function dx_order() {
$order_model = new OrderModel();
$order_where = [
'package_type' => ['in',HttpOrderEnum::$package_list],
'package_type' => ['in', HttpOrderEnum::$package_list],
'order_status' => HttpOrderEnum::$pay_yes,
'user_id' => $this->userinfo['UserId']
];
$order_list = $order_model->getListPage($order_where);
foreach ($order_list as &$info) {
$info['order_type'] = HttpOrderEnum::$order_type[$info['order_type']];
$info['package_type'] = HttpOrderEnum::$package_type[$info['package_type']];
$info['durationType'] = HttpOrderEnum::$durationType[ $info['durationType']];
$info['durationType'] = HttpOrderEnum::$durationType[$info['durationType']];
}
$return_data = [
@@ -140,11 +137,11 @@ class User extends Controller
$request_data = [
'sgUserId' => $this->http_user_info['sgUserId'],
];
$url = $this->url_root.'/user/short/ip/used/summary';
$url = $this->url_root . '/user/short/ip/used/summary';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$return_data = [
'code' => 1,
'data' => $data->d,
@@ -152,28 +149,27 @@ class User extends Controller
];
echo json_encode($return_data);
}
//用户短效每日使用情况查询
public function dx_used_log() {
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data = [
'sgUserId' => $this->http_user_info['sgUserId'],
'page' => isset($request_data['page'])?$request_data['page']:1,
'page' => isset($request_data['page']) ? $request_data['page'] : 1,
'limit' => 50,
'packType' => $request_data['packType'],
];
$url = $this->url_root.'/user/short/ip/used/list';
$url = $this->url_root . '/user/short/ip/used/list';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
foreach ($data->d->items as &$info) {
$info->packType = HttpOrderEnum::$package_type[$info->packType];
$info->createTime = date('Y-m-d H:i:s',$info->createTime);
$info->createTime = date('Y-m-d H:i:s', $info->createTime);
}
$return_data = [
'code' => 1,
@@ -182,14 +178,13 @@ class User extends Controller
];
echo json_encode($return_data);
}
//长效ip列表
public function lang_ip_list() {
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
$url = $this->url_root.'/user/long/ip/list';
$url = $this->url_root . '/user/long/ip/list';
foreach ($request_data as $key => &$info) {
if (strlen($info) == 0) {
@@ -198,8 +193,8 @@ class User extends Controller
}
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$line_status = [
'1' => '正常',
@@ -209,10 +204,10 @@ class User extends Controller
foreach ($data->d->items as &$info) {
$info->lineType2 = $info->lineType;
$info->lineType = ($info->lineType == 1)?'普通':'优质';
$info->expireTime = date('Y-m-d H:i:s',$info->expireTime);
$info->lineType = ($info->lineType == 1) ? '普通' : '优质';
$info->expireTime = date('Y-m-d H:i:s', $info->expireTime);
$info->shareType2 = $info->shareType;
$info->shareType = ($info->shareType == 1)?'共享':'独享';
$info->shareType = ($info->shareType == 1) ? '共享' : '独享';
$info->state = $line_status[$info->state];
}
@@ -225,25 +220,25 @@ class User extends Controller
echo json_encode($return_data);
}
//长效全部套餐
public function cx_package() {
//长效全部套餐
public function cx_package() {
$list = [];
$request_data = [
'sgUserId' => $this->http_user_info['sgUserId'],
];
$url = $this->url_root.'/user/long/pack/list';
$url = $this->url_root . '/user/long/pack/list';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$list = array_merge($data->d->packs);
foreach ($list as &$info) {
$info->isAbroad2 = $info->isAbroad;
$info->isAbroad = HttpOrderEnum::$game_type[ $info->isAbroad];
$info->expireTime = date('Y-m-d H:i:s',$info->expireTime);
$info->isExpired = $info->isExpired?'已过期':'未过期';
$info->shareType = ($info->shareType == 1) ?'共享':'独享';
$info->isAbroad = HttpOrderEnum::$game_type[$info->isAbroad];
$info->expireTime = date('Y-m-d H:i:s', $info->expireTime);
$info->isExpired = $info->isExpired ? '已过期' : '未过期';
$info->shareType = ($info->shareType == 1) ? '共享' : '独享';
}
$return_data = [
@@ -253,7 +248,6 @@ class User extends Controller
];
echo json_encode($return_data);
}
//长效全部订单
@@ -270,7 +264,7 @@ class User extends Controller
foreach ($order_list as &$info) {
$info['order_type'] = HttpOrderEnum::$order_type[$info['order_type']];
$info['package_type'] = HttpOrderEnum::$package_type[$info['package_type']];
$info['game_type'] = HttpOrderEnum::$game_type[ $info['game_type']];
$info['game_type'] = HttpOrderEnum::$game_type[$info['game_type']];
}
$return_data = [
@@ -285,19 +279,19 @@ class User extends Controller
//长效ip切换记录
public function cx_switch() {
ini_set('display_errors', 'off');
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data = [
'sgUserId' => $this->http_user_info['sgUserId'],
'page' => isset($request_data['page'])?$request_data['page']:1,
'page' => isset($request_data['page']) ? $request_data['page'] : 1,
'limit' => 50,
];
$url = $this->url_root.'/user/long/switch/ip/log';
$url = $this->url_root . '/user/long/switch/ip/log';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
//切换原因0-系统自动切换1-失效手动切换2-免费手动切换5-管理员免费切换6-收费手动切换
$reason = [
0 => '系统自动切换1',
@@ -306,9 +300,9 @@ class User extends Controller
5 => '管理员免费切换',
6 => '收费手动切换',
];
foreach ($data->d->items as &$info) {
$info->createTime = date('Y-m-d H:i:s',$info->createTime);
$info->createTime = date('Y-m-d H:i:s', $info->createTime);
$info->reason = $reason[$info->reason];
}
@@ -327,15 +321,15 @@ class User extends Controller
$request_data = [
'sgUserId' => $this->http_user_info['sgUserId'],
];
$url = $this->url_root.'/user/short/whitelist';
$url = $this->url_root . '/user/short/whitelist';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$list = $data->d->items;
foreach ($list as &$info) {
$info->isLocked = $info->isLocked?'已锁定':'未锁定';
$info->isLocked = $info->isLocked ? '已锁定' : '未锁定';
}
$return_data = [
@@ -349,15 +343,15 @@ class User extends Controller
//用户创建白名单
public function create_white_ip() {
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
$url = $this->url_root.'/user/short/whitelist/create';
$url = $this->url_root . '/user/short/whitelist/create';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$return_data = [
'code' => 1,
'msg' => '',
@@ -368,15 +362,15 @@ class User extends Controller
//用户锁定ip
public function lock_ip() {
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
$url = $this->url_root.'/user/short/whitelist/lock';
$url = $this->url_root . '/user/short/whitelist/lock';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$return_data = [
'code' => 1,
'msg' => '',
@@ -387,15 +381,15 @@ class User extends Controller
//用户删除ip
public function delete_ip() {
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
$url = $this->url_root.'/user/short/whitelist/delete';
$url = $this->url_root . '/user/short/whitelist/delete';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$return_data = [
'code' => 1,
'msg' => '',
@@ -403,19 +397,170 @@ class User extends Controller
echo json_encode($return_data);
}
//提取长效ip
public function get_lang_ip(){
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
$request_data['ids'] = trim($request_data['ids'],',');
public function get_lang_ip() {
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data['ids'] = trim($request_data['ids'], ',');
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
$url = $this->url_root.'/user/long/ip/batch/get';
$url = $this->url_root . '/user/long/ip/batch/get';
$request_data = formatHttpRequert($request_data);
echo(linkcurl($url,'GET',$request_data,[],0));
echo (linkcurl($url, 'GET', $request_data, [], 0));
}
// 短效无限量白名单列表
public function white_list_su() {
$list = [];
$request_data = [
'sgUserId' => $this->http_user_info['sgUserId'],
];
$url = $this->url_root . '/user/short/unlimited/whitelist';
}
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
if ($data->s < 0) {
echo json_encode([
'code' => 0,
'msg' => $data->m,
]);
return;
}
$list = $data->d->items;
foreach ($list as &$info) {
$info->isLocked = $info->isLocked ? '已锁定' : '未锁定';
}
$return_data = [
'code' => 1,
'data' => $list,
'msg' => '',
];
echo json_encode($return_data);
}
// 短效无限量白名单创建
public function create_white_ip_su() {
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
$url = $this->url_root . '/user/short/unlimited/whitelist/create';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$return_data = [
'code' => 1,
'msg' => '',
];
echo json_encode($return_data);
}
// 短效无限量白名单删除
public function delete_ip_su() {
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
$url = $this->url_root . '/user/short/unlimited/whitelist/delete';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$return_data = [
'code' => 1,
'msg' => '',
];
echo json_encode($return_data);
}
// 短效无限量白名单切换锁定
public function lock_ip_su() {
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
$url = $this->url_root . '/user/short/unlimited/whitelist/lock';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
$return_data = [
'code' => 1,
'msg' => '',
];
echo json_encode($return_data);
}
// 短效无限量白名单查询上限
public function white_limit_get_su() {
$request_data = [
'sgUserId' => $this->http_user_info['sgUserId'],
];
$url = $this->url_root . '/user/short/unlimited/whitelist/maxAmount';
$request_data = formatHttpRequert($request_data);
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
echo json_encode([
'code' => 1,
'data' => $data->d->maxAmount,
'msg' => '',
]);
}
// 短效无限量白名单修改上限
public function white_limit_set_su() {
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
$url = $this->url_root . '/user/short/unlimited/whitelist/edit/maxAmount';
$request_data = formatHttpRequert($request_data);
$resp = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
if ($resp->s < 0) {
echo json_encode([
'code' => -1,
'msg' => $resp->m,
]);
return;
}
echo json_encode([
'code' => 1,
'data' => $resp,
'msg' => '',
]);
}
// 用户短效当前可用的无限量套餐详情
public function get_unlimited_available() {
$url = $this->url_root . '/user/short/pack/unlimited/available';
$request_data = formatHttpRequert([
'sgUserId' => $this->http_user_info['sgUserId'],
]);
$resp = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
if ($resp->s < 0) {
echo json_encode([
'code' => -1,
'msg' => $resp->m,
]);
return;
}
echo json_encode([
'code' => 1,
'data' => $resp->d,
]);
}
}

View File

@@ -39,6 +39,7 @@ class Package extends Model
$where = $data['data'];
$where['package_type'] = HttpOrderEnum::$dxwxl;
$where['periodAmount'] = 1;
unset($where['maxWhitelist']);
break;
case 3:
$where = $data['data'];

View File

@@ -4,6 +4,7 @@ namespace app\jinyou\controller;
use extend\jinyouapi\Jinyou;
use fastphp\base\Controller;
use app\product\model\ProductAccount as AccountModel;
class Jinyoudt extends Controller
{
@@ -12,6 +13,23 @@ class Jinyoudt extends Controller
if(!$data){
die;
}
$where = [
'ProductId' => $data['productId'],
'DeleteTag' => 0,
'Account' => $data['account']
];
$account_model = new AccountModel;
$im_now = $account_model->getOne($where);
$im = 1;
if ($im_now['im']) {
$im = 0;
}
$account_model->updateOne($where, ['im' => $im]);
$jinyou = new Jinyou();
$status = $jinyou::openTxLimit($data['account']);
echo json_encode(['Code'=>30000,]);

View File

@@ -10,11 +10,15 @@ use app\jinyou\model\Package as PackageModel;
use app\jinyou\model\PriceScheme as SchemeModel;
use app\jinyou\model\UserPrice as UserPriceModel;
use app\jinyou\model\ProductOrder as ProductOrderModel;
use app\jinyou\model\ProductAccount as ProductAccountModel;
use enum\order\ProductOrder as OrderEnum;
use app\user\model\UserScore as UserScore;
use app\jinyou\model\Account as AccountModel;
use extend\wechatpay\Wxpay;
use extend\alipay\Alipay;
use app\agent\model\AgentUser as AgentModel;
use app\agent\model\ProductPriceScheme;
use app\agent\model\AgentScore as AgentScoreModel;
class Jinyoujt extends Controller
{
@@ -63,7 +67,7 @@ class Jinyoujt extends Controller
//创建静态订单
public function create_order() {
$request_data = json_decode(file_get_contents("php://input"),true)['order_info'];
$return_data['code'] = 0;
$request_data['price'] = abs($request_data['price']);
@@ -71,11 +75,11 @@ class Jinyoujt extends Controller
$user_model = new UserModel;
$jinyoujingtai = new Jinyoujingtai;
$package_model = new PackageModel;
$product_account = new ProductAccountModel;
$user_update_info = [];
$user_info = $user_model->getOne(['Id' => $this->userinfo['UserId']]);
//套餐详情
$package_info = $package_model->getOne(['Id' => $request_data['package_id']]);
@@ -114,6 +118,20 @@ class Jinyoujt extends Controller
}
//判断账号是否存在
$timezone = new \DateTimeZone('Asia/Shanghai');
$datetime = new \DateTime('now', $timezone); // 确保是东八区时间
$account_result = $product_account->getCount([
'ProductId' => $package_info['ProductId'],
'Account' => $request_data['account'],
'EndTime' => ['>',$datetime->format('Y-m-d H:i:s')]
]);
if($account_result['count'] > 0){
$return_data['code'] = -1;
$return_data['msg'] = "账号已经存在!";
echo json_encode($return_data);
die;
}
$exist = $jinyoujingtai::checkVpnAccountExists($request_data['account'],$request_data['type']);
if($exist->code != 200){
$return_data['code'] = -1;
@@ -142,11 +160,11 @@ class Jinyoujt extends Controller
$order_enum = new OrderEnum;
//判断新开类型
//判断新开类型
$OrderType = $order_enum::$New;
if ($request_data['buy_num'] > 1) {
$OrderType = $order_enum::$News;
}
}
$OtherPayAmount = 0;
$AccountPayAmount = 0;
@@ -197,6 +215,7 @@ class Jinyoujt extends Controller
'EndTime' => $endtime,
'IsAutoRefund' => $product_info['AutoRefund'],
'BackAmount' => 0,
'agent_id' => $user_info['agent_id'],
'remark2' => json_encode($request_data)
];
@@ -238,9 +257,56 @@ class Jinyoujt extends Controller
$order_info['OrderState'] = $order_enum::$Complete;
//添加订单
$order_model->add($order_info);
$account_model = new AccountModel;
$return_data = $account_model->open_account($request_data,$user_info,$package_info);
//代理计算
if($order_info['agent_id'] != 0 && $order_info['PaymentAmount'] != 0.1){
$agent_model = new AgentModel();
$agent_info = $agent_model->getOne(['id' => $order_info['agent_id']]);
//根据折扣设置价格
$score_money = 0.00;
if($agent_info['discount_id'] != 0){
$scheme_model = new ProductPriceScheme();
//获取代理折扣
$discount = $scheme_model->getOne(['Id' => $agent_info['discount_id']]);
$price = $package_info['LinePrice'] * $discount['discount'] / 100;
if ($price < $package_info['MinPrice']) {
$price = $package_info['MinPrice'];
}
$score_money = $order_info['PaymentAmount'] - $order_info['ConnectCount'] * $order_info['AccountCount'] * $price;
}
$score_model = new AgentScoreModel();
$score_data = [
'agent_id' => $order_info['agent_id'],
'order_id' => $order_info['Id'],
'score_type' => 1,
'score_value' => $score_money,
'remark' => "客户购买产品".$order_info['Accounts'],
'agent_name' => $agent_info['username'],
'op_user' => $order_info['UserName'],
'rest_amount1' => $agent_info['account'],
'rest_amount2' => $agent_info['account'] + $score_money
];
$agent_data = ['account' => ($agent_info['account'] + $score_money)];
$score_model->add($score_data);
$agent_model->updateOne(['id' => $order_info['agent_id']],$agent_data);
}
echo json_encode($return_data);
} else {
$return_data['code'] = -1;
@@ -259,8 +325,8 @@ class Jinyoujt extends Controller
];
//添加订单
$order_model->add($order_info);
$pay_html = Alipay::pay_jinyou($param);
$info = [
'code'=>2,
@@ -268,7 +334,7 @@ class Jinyoujt extends Controller
];
echo json_encode($info);
} else if($request_data['pay_type'] == $order_enum::$Wechat) {
$order_model->add($order_info);
//微信支付
$wxpay = new Wxpay();
@@ -321,7 +387,7 @@ class Jinyoujt extends Controller
}
$jinyoujingtai = new Jinyoujingtai;
$data = $jinyoujingtai::regionSurplusOuts($product_shuidi_id,$is_unshar,$game_id);
echo json_encode($data);
@@ -331,19 +397,19 @@ class Jinyoujt extends Controller
public function change_ip_list() {
$info = json_decode(file_get_contents("php://input"),true)['data'];
$jinyoujingtai = new Jinyoujingtai;
$data = $jinyoujingtai::switchIpList(121,$info['account'],$info['type']);
echo json_encode($data);
}
//切换的ip
public function change_ip() {
$info = json_decode(file_get_contents("php://input"),true)['data'];
$jinyoujingtai = new Jinyoujingtai;
$account_model = new AccountModel;
$where = [
'ProductId' => 28,
@@ -355,21 +421,21 @@ class Jinyoujt extends Controller
if ($info['chinge_addr']['rid'] != 0 ) {
$data = $jinyoujingtai::changeRegion(121,$info['chinge_addr']['province_id'],$info['chinge_addr']['rid'],$info['chinge_addr']['account'],$info['chinge_addr']['type']);
}
if ($info['chinge_ip']['ip_id'] != 0 ) {
$data = $jinyoujingtai::saveSwitchIp(121,$info['chinge_ip']['account'],$info['chinge_ip']['type'],$info['chinge_ip']['ip_id']);
}
$shuidi_account_data = $jinyoujingtai::accountInfo(121,$info['chinge_ip']['account'],$info['chinge_ip']['type']);
$update_data = [
'Remark' => $shuidi_account_data->data->region.$shuidi_account_data->data->address,
'Raw' => $shuidi_account_data->data->inlet_website,
];
$account_model->updateOne($where,$update_data);
echo json_encode(['code' => 1]);
}
//解除屏蔽
@@ -384,9 +450,27 @@ class Jinyoujt extends Controller
if ($package[0] == '静态') {
$type = 0;
}
$where = [
'ProductId' => $data['productId'],
'DeleteTag' => 0,
'Account' => $data['account']
];
$account_model = new AccountModel;
$im_now = $account_model->getOne($where);
$im = 1;
if ($im_now['im']) {
$im = 0;
}
$account_model->updateOne($where, ['im' => $im]);
$jinyou = new Jinyoujingtai();
$status = $jinyou::setFirewallStatus($data['account'],$type,121);
echo json_encode(['Code'=>30000,]);
}
}
}

View File

@@ -46,6 +46,10 @@ class Package extends Model
if ($price < $package_price) {
$package['Price'] = $price;
}
if ($price > $package_price && $price < 1000000) {
$package['Price'] = $price;
}
}
if (isset($package_info[3])) {

View File

@@ -0,0 +1,10 @@
<?php
namespace app\jinyou\model;
use fastphp\base\Model;
class ProductAccount extends Model
{
protected $table = "product_account";
}

View File

@@ -31,6 +31,10 @@ class UserPrice extends Model
if ($price < $package_info['Price']) {
$package_info['Price'] = $price;
}
if ($price > $package_info['Price'] && $price < 100000) {
$package_info['Price'] = $price;
}
}
return $package_info['Price'];

View File

@@ -64,4 +64,34 @@ class Account extends Controller
\result($count,'',30000);
}
public function delete() {
$data = json_decode(file_get_contents("php://input"), true);
$account_model = new ProductAccount;
$where = [
'Id' => $data['id'],
'DeleteTag' => 0,
'EndTime' => ['<',date('Y-m-d H:i:s')]
];
$account_info = $account_model->getOne($where);
if ($account_info) {
$update_data['DeleteTag'] = 1;
if ($account_info['ProductId'] == 29) {
$url = "http://124.236.113.166:18702/api/agent/deleteAcct/apikey/80cf4f64e990b78a9fc5eb/account/".$account_info['Account'];
linkcurl($url,'GET',[],[],0);
} elseif ($account_info['ProductId'] == 3 || $account_info['ProductId'] == 26) {
$url = "http://106.119.166.87:18702/api/agent/deleteAcct/apikey/80cf4f64e990b78a9fc5eb/account/".$account_info['Account'];
linkcurl($url,'GET',[],[],0);
}
$account_model->updateOne($where,$update_data);
}
echo json_encode(['Code'=>30000,]);
}
}

View File

@@ -140,18 +140,24 @@ class SellInfo extends Controller
// $data['cost_not_mogu'] = "其他营业额($cost_not_mogu_data)";
// $data['sell_percent'] = "我的营业额($user_cost)/总营业额($all_cost)=" . $sell_percent . '%';
$data['other_order_active'] = "其他IP产品:" . $sell_money_list['other_order_1'];
$data['mogu_order_active'] = "蘑菇IP产品:" . $sell_money_list['mogu_order_1'];
$data['other_order_active'] = "合营IP产品:" . $sell_money_list['other_order_1'];
$data['self_order_active'] = "自营IP产品:" . $sell_money_list['self_order_1'];
// $data['mogu_order_active'] = "蘑菇IP产品:" . $sell_money_list['mogu_order_1'];
// $data['jihu_order_active'] = "极狐IP产品:" . $sell_money_list['jihu_order_1'];
// $data['jiguang_order_active'] = "极光IP产品:" . $sell_money_list['jiguang_order_1'];
$data['recharge_active'] = "IP充值:" . $sell_money_list['recharge_1'];
$data['http_active'] = "HTTP充值:" . $sell_money_list['http_1'];
$data['ros_active'] = "ROS订单:" . $sell_money_list['ros_1'];
$data['jinqiao_active'] = "金桥订单:" . $sell_money_list['jinqiao_1'];
$data['other_order_not_active'] = "其他IP产品:" . $sell_money_list['other_order_0'];
$data['mogu_order_not_active'] = "蘑菇IP产品:" . $sell_money_list['mogu_order_0'];
$data['jinqiao_active'] = "" . $sell_money_list['jinqiao_1'];
$data['other_order_not_active'] = "合营IP产品:" . $sell_money_list['other_order_0'];
$data['self_order_not_active'] = "自营IP产品:" . $sell_money_list['self_order_0'];
// $data['mogu_order_not_active'] = "蘑菇IP产品:" . $sell_money_list['mogu_order_0'];
// $data['jihu_order_not_active'] = "极狐IP产品:" . $sell_money_list['jihu_order_0'];
// $data['jiguang_order_not_active'] = "极光IP产品:" . $sell_money_list['jiguang_order_0'];
$data['recharge_not_active'] = "IP充值:" . $sell_money_list['recharge_0'];
$data['http_not_active'] = "HTTP充值:" . $sell_money_list['http_0'];
$data['ros_not_active'] = "ROS订单:" . $sell_money_list['ros_0'];
$data['jinqiao_not_active'] = "金桥订单:" . $sell_money_list['jinqiao_0'];
$data['jinqiao_not_active'] = "" . $sell_money_list['jinqiao_0'];
$data['cost_percent'] = "需维护的已消费客户($user_cost_num)/总的已消费客户($all_cost_num)=" . $cost_percent . '%';
@@ -289,21 +295,27 @@ class SellInfo extends Controller
$cost_mogu_data = round($mogu_cost-$mogu_refund_cost,2);
//其他营业额
$cost_not_mogu_data = round($user_cost-$cost_mogu_data-$refund,2);
$data['other_order_active'] = "其他IP产品:" . $sell_money_list['other_order_1'];
$data['mogu_order_active'] = "蘑菇IP产品:" . $sell_money_list['mogu_order_1'];
$data['other_order_active'] = "合营IP产品:" . $sell_money_list['other_order_1'];
$data['self_order_active'] = "自营IP产品:" . $sell_money_list['self_order_1'];
// $data['mogu_order_active'] = "蘑菇IP产品:" . $sell_money_list['mogu_order_1'];
// $data['jihu_order_active'] = "极狐IP产品:" . $sell_money_list['jihu_order_1'];
// $data['jiguang_order_active'] = "极光IP产品:" . $sell_money_list['jiguang_order_1'];
$data['recharge_active'] = "IP充值:" . $sell_money_list['recharge_1'];
$data['http_active'] = "HTTP充值:" . $sell_money_list['http_1'];
$data['ros_active'] = "ROS订单:" . $sell_money_list['ros_1'];
$data['jinqiao_active'] = "金桥订单:" . $sell_money_list['jinqiao_1'];
$data['other_order_not_active'] = "其他IP产品:" . $sell_money_list['other_order_0'];
$data['mogu_order_not_active'] = "蘑菇IP产品:" . $sell_money_list['mogu_order_0'];
$data['jinqiao_active'] = "" . $sell_money_list['jinqiao_1'];
$data['other_order_not_active'] = "合营IP产品:" . $sell_money_list['other_order_0'];
$data['self_order_not_active'] = "自营IP产品:" . $sell_money_list['self_order_0'];
// $data['mogu_order_not_active'] = "蘑菇IP产品:" . $sell_money_list['mogu_order_0'];
// $data['jihu_order_not_active'] = "极狐IP产品:" . $sell_money_list['jihu_order_0'];
// $data['jiguang_order_not_active'] = "极光IP产品:" . $sell_money_list['jiguang_order_0'];
$data['recharge_not_active'] = "IP充值:" . $sell_money_list['recharge_0'];
$data['http_not_active'] = "HTTP充值:" . $sell_money_list['http_0'];
$data['ros_not_active'] = "ROS订单:" . $sell_money_list['ros_0'];
$data['jinqiao_not_active'] = "金桥订单:" . $sell_money_list['jinqiao_0'];
$data['jinqiao_not_active'] = "" . $sell_money_list['jinqiao_0'];
$data['cost_mogu'] = "蘑菇营业额($cost_mogu_data)";
$data['cost_not_mogu'] = "其他营业额($cost_not_mogu_data)";
// $data['cost_mogu'] = "蘑菇营业额($cost_mogu_data)";
// $data['cost_not_mogu'] = "其他营业额($cost_not_mogu_data)";
$data['sell_percent'] = "我的营业额($user_cost)/总营业额($all_cost)=" . $sell_percent . '%';
$data['cost_percent'] = "需维护的已消费客户($user_cost_num)/总的已消费客户($all_cost_num)=" . $cost_percent . '%';

View File

@@ -281,11 +281,21 @@ class UserFollow extends Controller
$info['op_user'] = $manager_info['RealName'];
switch($info['product_type']) {
case 'other_order':
$info['product_type'] = '其他IP产品订单';
$info['product_type'] = '合营IP订单';
break;
case 'self_order':
$info['product_type'] = '自营IP订单';
break;
case 'mogu_order':
$info['product_type'] = '蘑菇IP订单';
break;
case 'jihu_order':
$info['product_type'] = '极狐IP订单';
break;
case 'jiguang_order':
$info['product_type'] = '极光IP订单';
break;
case 'recharge':
$info['product_type'] = 'IP充值';
break;
@@ -346,6 +356,10 @@ class UserFollow extends Controller
}
$where .= " user_id=".$user_id['Id'].' ';
}
if (!empty($where)) {
$where .= " AND ";
}
$where .= " op_user<>0".' ';
$list = $follow_rcord->getNewRecord($where,"$page,50");
foreach ($list as &$info) {
@@ -353,11 +367,20 @@ class UserFollow extends Controller
$info['manager'] = $manager_id_list[$info['op_user']]['RealName'];
switch($info['product_type']) {
case 'other_order':
$info['product_type'] = '其他IP产品订单';
$info['product_type'] = '合营IP订单';
break;
case 'self_order':
$info['product_type'] = '自营IP订单';
break;
case 'mogu_order':
$info['product_type'] = '蘑菇IP订单';
break;
case 'jihu_order':
$info['product_type'] = '极狐IP订单';
break;
case 'jiguang_order':
$info['product_type'] = '极光IP订单';
break;
case 'recharge':
$info['product_type'] = 'IP充值';
break;
@@ -455,7 +478,7 @@ class UserFollow extends Controller
'sell_money' => 0,
'sell_type' => 0,
];
if ($data['product_type'] == 'other_order' || $data['product_type'] == 'mogu_order') {
if ($data['product_type'] == 'other_order' || $data['product_type'] == 'self_order' ) {
$sell_where = [
'UserId' => $data['user_id'],
'PaymentAmount' => $data['sell_money'],
@@ -706,46 +729,44 @@ class UserFollow extends Controller
\result($product_account_model->getUserAccount($id, $index));
}
//拨打电话进行维护
public function hujiao() {
$data = json_decode(file_get_contents("php://input"), true);
$phone = $data['phone'];
$data = json_decode(file_get_contents("php://input"), true);
$phone = $data['phone'];
$callers = ['1017'=>'15225139515','1029'=>'15713870747','1030'=>'15111748058'];
$operaterids = ['1017','1029','1030'];
$callers = ['1008'=>'17737957091','1029'=>'17737957091','1032'=>'17737957091'];
$operaterids = ['1008','1029','1032'];
if (!in_array($this->userinfo['OperaterID'],$operaterids)) {
die;
}
$caller = $callers[$this->userinfo['OperaterID']];
if (!in_array($this->userinfo['OperaterID'],$operaterids)) {
die;
}
$callee = $phone;
$serviceNumber = '02361933764';
$header = [
'Content-Type:application/json',
'app_id:f39b78fb812f192e221b55b752267b2c',
'timeStamp:'. time() * 1000
];
$caller = $callers[$this->userinfo['OperaterID']];
$callee = $phone;
$serviceNumber = '';
$header = [
'Content-Type:application/json',
'app_id:f39b78fb812f192e221b55b752267b2c',
'timeStamp:'. time() * 1000
];
$param = [
'caller' =>$caller,
'callee'=>$callee,
'serviceNumber'=>$serviceNumber,
'callBackUrl' =>"https://php-api.juip.com/api/hujiao/callback"
];
$param = [
'caller' =>$caller,
'callee'=>$callee,
'callBackUrl' =>"https://php-api.juip.com/api/hujiao/callback"
];
$back_data = json_decode(linkcurl('https://yunyuzhineng.cn:8888/voice/v1/call-rs','POST',json_encode($param),$header,0));
$back_data = json_decode(linkcurl('https://yunyuzhineng.cn:8888/voice/v1/call-rs','POST',json_encode($param),$header,0));
if ($back_data->code == 1000) {
\result([],'呼叫成功');
} else {
\result([],'呼叫失败',30000);
}
if ($back_data->code == 1000) {
\result([],'呼叫成功');
} else {
\result([],'呼叫失败',30000);
}
}
}
}

View File

@@ -102,26 +102,26 @@ class CashOutAdmin extends Controller
$cash_data = $cash->getOne(['id' => $id]);
if ($data['status'] == '1') {
$param = [
'out_biz_no' => '2020' . time() . rand(10000, 99999),
'trans_amount' => $cash_data['money'],
'product_code' => 'TRANS_ACCOUNT_NO_PWD',
'biz_scene' => 'DIRECT_TRANSFER',
'payee_info' => [
'identity' => $cash_data['alipay_account'],
'identity_type' => 'ALIPAY_LOGON_ID',
'name' => $cash_data['real_name'],
],
'remark' => '聚IP提现-会员' . $cash_data['username'] . '-' . $cash_data['money'] . '元',
];
$result = Alipay::transfer($param);
if ($result) {
$data['cash_no'] = $result->alipay_fund_trans_uni_transfer_response->out_biz_no;
$data['alipay_no'] = $result->alipay_fund_trans_uni_transfer_response->order_id;
// $param = [
// 'out_biz_no' => '2020' . time() . rand(10000, 99999),
// 'trans_amount' => $cash_data['money'],
// 'product_code' => 'TRANS_ACCOUNT_NO_PWD',
// 'biz_scene' => 'DIRECT_TRANSFER',
// 'payee_info' => [
// 'identity' => $cash_data['alipay_account'],
// 'identity_type' => 'ALIPAY_LOGON_ID',
// 'name' => $cash_data['real_name'],
// ],
// 'remark' => '聚IP提现-会员' . $cash_data['username'] . '-' . $cash_data['money'] . '元',
// ];
// $result = Alipay::transfer($param);
// if ($result) {
// $data['cash_no'] = $result->alipay_fund_trans_uni_transfer_response->out_biz_no;
// $data['alipay_no'] = $result->alipay_fund_trans_uni_transfer_response->order_id;
// $data['status'] = 1;
// } else {
$data['status'] = 1;
} else {
result([],'',30000);
}
// }
} else if ($data['status'] == '2') {
if ($cash_data['is_agent'] != 1){
$user_model = new UserModel;

View File

@@ -0,0 +1,36 @@
<?php
namespace app\product\controller;
use fastphp\base\Controller;
use app\product\model\ProductAccount as AccountModel;
class Account extends Controller
{
public function updatePasswd(){
$data = json_decode(file_get_contents("php://input"),true);
if(!$data){
die;
}
$where = [
'ProductId' => $data['productId'],
'DeleteTag' => 0,
'Account' => ['IN', explode(',', $data['accounts'])]
];
$account_model = new AccountModel;
$account_model->updateOne($where, ['Pwd' => $data['pwd']]);
if ($data['productId'] == 18) {
$url = "http://rds-api.juip.com/api/agent/changeManyPasswd/accts/".$data['accounts'].'/pass/'.$data['pwd'];
} elseif ($data['productId'] == 29) {
$url = "http://124.236.113.166:18702/api/agent/changeManyPasswd/apikey/80cf4f64e990b78a9fc5eb/accts/".$data['accounts'].'/pass/'.$data['pwd'];
} elseif ($data['productId'] == 3 || $data['productId'] == 26) {
$url = "http://106.119.166.87:18702/api/agent/changeManyPasswd/apikey/80cf4f64e990b78a9fc5eb/accts/".$data['accounts'].'/pass/'.$data['pwd'];
}
linkcurl($url,'GET',[],[],0);
echo json_encode(['Code'=>10000,]);
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace app\product\controller;
use fastphp\base\Controller;
use app\product\model\ProductAccount as AccountModel;
class OpenAccountLimit extends Controller
{
public function openTxLimit(){
$data = json_decode(file_get_contents("php://input"),true);
if(!$data){
die;
}
$where = [
'ProductId' => $data['productId'],
'DeleteTag' => 0,
'Account' => $data['account']
];
$account_model = new AccountModel;
$account_model->updateOne($where, ['im' => '1']);
// dump($data);die;
if ($data['productId'] == 18) {
$url = "http://rds-api.juip.com/api/agent/openIM/account/".$data['account'];
} elseif ($data['productId'] == 29) {
$url = "http://124.236.113.166:18702/api/agent/openIM/apikey/80cf4f64e990b78a9fc5eb/account/".$data['account'];
} elseif ($data['productId'] == 3 || $data['productId'] == 26) {
$url = "http://106.119.166.87:18702/api/agent/openIM/apikey/80cf4f64e990b78a9fc5eb/account/".$data['account'];
}
linkcurl($url,'GET',[],[],0);
echo json_encode(['Code'=>30000,]);
}
}

View File

@@ -107,16 +107,25 @@ class Index
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
if ($has_user){
$info = [
'Code' => 20000,
'Data' => '',
'Message' => '该账号或者手机号被注册了',
];
echo json_encode($info);
die;
if ($has_user['is_verify'] == 0) {
$data_user_old = [
'LoginCode' => $has_user['LoginCode'].'-del',
'Phone' => $has_user['Phone'].'-del',
];
$user_model->updateOne(['Id'=>$has_user['Id']],$data_user_old);
}
// $info = [
// 'Code' => 20000,
// 'Data' => '',
// 'Message' => '该账号或者手机号被注册了',
// ];
// echo json_encode($info);
// die;
}
$has_user2 = $user_model->isExit("id_code='".$data['id_code']."' and is_verify=1'");
$has_user2 = $user_model->isExit("id_code='".$data['id_code']."' and is_verify=1");
if ($has_user2){
$info = [
'Code' => 30000,

View File

@@ -110,16 +110,25 @@ class Realname
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
if ($has_user){
$info = [
'Code' => 20000,
'Data' => '',
'Message' => '该账号或者手机号被注册了',
];
echo json_encode($info);
die;
if ($has_user['is_verify'] == 0) {
$data_user_old = [
'LoginCode' => $has_user['LoginCode'].'-del',
'Phone' => $has_user['Phone'].'-del',
];
$user_model->updateOne(['Id'=>$has_user['Id']],$data_user_old);
}
// $info = [
// 'Code' => 20000,
// 'Data' => '',
// 'Message' => '该账号或者手机号被注册了',
// ];
// echo json_encode($info);
// die;
}
$has_user2 = $user_model->isExit("id_code='".$data['id_code']."' and is_verify=1'");
$has_user2 = $user_model->isExit("id_code='".$data['id_code']."' and is_verify=1");
if ($has_user2){
$info = [
'Code' => 30000,

View File

@@ -38,6 +38,7 @@ return [
'https://www.juip.com',
'https://juip.com',
'http://taobao.juip.com',
'http://register.wyk'
],
// 跨域请求
'origin' => [
@@ -57,6 +58,7 @@ return [
'http://rg.jkip.com',
'http://http.wyk',
'http://taobao.juip.com',
'http://register.wyk'
],
//支付宝
'alipay' => [

49
docker-compose.yaml Normal file
View File

@@ -0,0 +1,49 @@
name: juipphp
services:
mysql:
image: mysql:8.0.21
environment:
MYSQL_ROOT_PASSWORD: 123456789
MYSQL_DATABASE: hualianyun
ports:
- "3306:3306"
command: --default-authentication-plugin=mysql_native_password
volumes:
- ./.volumes/mysql:/var/lib/mysql
php:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./alipay:/var/www/html/alipay
- ./app:/var/www/html/app
- ./config:/var/www/html/config
- ./enum:/var/www/html/enum
- ./extends:/var/www/html/extends
- ./fastphp:/var/www/html/fastphp
- ./script:/var/www/html/script
- ./vendor:/var/www/html/vendor
- ./.htaccess:/var/www/html/.htaccess
- ./index.php:/var/www/html/index.php
depends_on:
- mysql
nginx:
image: nginx:alpine
volumes:
- ./nginx.conf:/etc/nginx/conf.d/app.conf
- ./alipay:/var/www/html/alipay
- ./app:/var/www/html/app
- ./config:/var/www/html/config
- ./enum:/var/www/html/enum
- ./extends:/var/www/html/extends
- ./fastphp:/var/www/html/fastphp
- ./script:/var/www/html/script
- ./vendor:/var/www/html/vendor
- ./.htaccess:/var/www/html/.htaccess
- ./index.php:/var/www/html/index.php
ports:
- 9000:9000

View File

@@ -36,7 +36,7 @@ class Sms
$sendSmsRequest = new SendSmsRequest([
"phoneNumbers" => $phone,
"signName" => "华连云",
"templateCode" => "SMS_186355045",
"templateCode" => "SMS_483310379",
"templateParam" => "{\"code\":\"$vcode\"}"
]);
// 复制代码运行请自行打印 API 的返回值
@@ -62,7 +62,7 @@ class Sms
$client = self::createClient("LTAI4FmSkDSwFuXeLxsDB3jB", "r8FfRmoeWcCJyZSqqkQP2G3dKPPl2N");
$sendSmsRequest = new SendSmsRequest([
"phoneNumbers" => $phone,
"signName" => "聚IP",
"signName" => "河南华连网络科技",
"templateCode" => "SMS_462280213",
"templateParam" => json_encode($data)
]);
@@ -89,7 +89,7 @@ class Sms
$client = self::createClient("LTAI4FmSkDSwFuXeLxsDB3jB", "r8FfRmoeWcCJyZSqqkQP2G3dKPPl2N");
$sendSmsRequest = new SendSmsRequest([
"phoneNumbers" => $phone,
"signName" => "聚IP商城",
"signName" => "河南华连网络科技",
"templateCode" => "SMS_463687988",
"templateParam" => json_encode($data)
]);

View File

@@ -43,7 +43,21 @@ class Jinyoujingtai{
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5); // 设置CURL超时时间
$response = curl_exec($ch);
// 检查是否因为超时而返回FALSE
if ($response === false) {
$error = curl_error($ch);
if (strpos($error, 'Operation timed out') !== false || curl_errno($ch) === CURLE_OPERATION_TIMEDOUT) {
// 这里处理超时异常
echo json_encode(["code"=> 200,"data"=>[]]);
} else {
// 这里处理其他CURL错误
echo json_encode(["code"=> 200,"data"=>[]]);
}
die;
}
curl_close($ch);
return $response;

33
nginx.conf Normal file
View File

@@ -0,0 +1,33 @@
server {
listen 9000;
server_name _;
# CORS
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
# pre-flight requests
if ($request_method = 'OPTIONS') {
return 204;
}
index index.php;
root /var/www/html;
location ~ \.php(.*)$ {
fastcgi_pass php:9000;
include fastcgi_params;
fastcgi_param PATH_INFO $1;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location / {
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
}

View File

@@ -17,7 +17,7 @@ $update_data = [
];
$where_month = [
'EndTime' => ['<',date("Y-m-d H:i:s", strtotime("-2 month"))]
'EndTime' => ['<',date("Y-m-d H:i:s", strtotime("-1 week"))]
];
$account_model->updateOne($where,$update_data);

View File

@@ -1,7 +1,7 @@
<?php
function auto_format_list(){
$product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19,22,23,25,26,27,28];
$product_list = [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19,22,23,25,26,27,28,29];
foreach ($product_list as $product) {
switch ($product) {
case 0:
@@ -69,6 +69,12 @@ function auto_format_list(){
case 28:
format_shuidi_product(__DIR__ . '/data/shuidi.csv','sdip.cc');
break;
case 29:
format_product(__DIR__ . '/data/jihu.csv','jhip.net');
break;
case 3:
format_product(__DIR__ . '/data/jiguang.csv','jgip.cc');
break;
}
}
}
@@ -125,6 +131,12 @@ function format_all_product($file_path)
case '蘑菇':
$dns = 'mgip.net';
break;
case '极狐':
$dns = 'jhip.net';
break;
case '极光':
$dns = 'jgip.cc';
break;
case '火狐静态':
$dns = 'hhip.vip';
break;

View File

@@ -55,6 +55,12 @@ switch ($id) {
case 18:
get_product(__DIR__ . '/data/download/mogu.csv');
break;
case 29:
get_product(__DIR__ . '/data/download/jihu.csv');
break;
case 3:
get_product(__DIR__ . '/data/download/jiguang.csv');
break;
case 19:
get_product(__DIR__ . '/data/download/huohu.csv');
break;

View File

@@ -20,50 +20,68 @@ ini_set("display_errors", 0);
// // //测试用----------------------------------------------------------------------------------------------------------
// $shuidi = new Jinyoujt;
// $url = "https://www.jyip.net/static-list";
// $shuidi_api_data = json_decode(file_get_contents($url),true)['data'];
// if ($shuidi_api_data) {
// $shuidi_data = get_product(__DIR__ . '/data/shuidi.csv');
// $shuidi_f = fopen(__DIR__ . '/data/shuidi.csv', 'w');
// shuidi_getList($shuidi_api_data, $shuidi_f, $all,$shuidi_data);
// fclose($shuidi_f);
//极光
// $url = "http://106.119.166.87:18702/api/agent/getList2?apikey=80cf4f64e990b78a9fc5eb";
// $jiguang = json_decode(file_get_contents($url), true)['data'];
// if ($jiguang) {
// $jiguang_f = fopen(__DIR__ . '/data/jiguang.csv', 'w');
// jiguang_getList($jiguang, $jiguang_f, $all);
// fclose($jiguang_f);
// }
// die;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$dnx_has_exit = [];
//强子迅联特征码
$sp_xl_code = file_get_contents(__DIR__ . '/data/xl.txt', 'r');
// //强子迅联特征码
// $sp_xl_code = file_get_contents(__DIR__ . '/data/xl.txt', 'r');
// echo $sp_xl_code;
// // echo $sp_xl_code;
$sp_xl_json = json_decode(substr($sp_xl_code,3),true);
$sp_xl_list = [];
foreach($sp_xl_json as $k=>$v){
$temp = explode('-',$k);
$sp_xl_list[$temp[1]] = $v;
}
// $sp_xl_json = json_decode(substr($sp_xl_code,3),true);
// $sp_xl_list = [];
// foreach($sp_xl_json as $k=>$v){
// $temp = explode('-',$k);
// $sp_xl_list[$temp[1]] = $v;
// }
$sp_qz_code = file_get_contents(__DIR__ . '/data/qz.txt', 'r');
// $sp_qz_code = file_get_contents(__DIR__ . '/data/qz.txt', 'r');
// echo $sp_qz_code;
// // echo $sp_qz_code;
$sp_qz_json = json_decode(substr($sp_qz_code,3),true);
$sp_qz_list = [];
foreach($sp_qz_json as $k=>$v){
$temp = explode('-',$k);
$sp_qz_list[$temp[1]] = $v;
}
// $sp_qz_json = json_decode(substr($sp_qz_code,3),true);
// $sp_qz_list = [];
// foreach($sp_qz_json as $k=>$v){
// $temp = explode('-',$k);
// $sp_qz_list[$temp[1]] = $v;
// }
//--------------------------------------------
$all = fopen(__DIR__ . '/data/all.csv', 'w');
$dnx_exit = fopen(__DIR__ . '/data/dns_diff.csv', 'a');
$dnx_has_exit = get_product(__DIR__ . '/data/dns_diff.csv', 1);
//-----------------------------------------------------------------------------------------------------
//极狐
$url = "http://124.236.113.166:18702/api/agent/getList2?apikey=80cf4f64e990b78a9fc5eb";
$jihu = json_decode(file_get_contents($url), true)['data'];
if ($jihu) {
$jihu_f = fopen(__DIR__ . '/data/jihu.csv', 'w');
jihu_getList($jihu, $jihu_f, $all);
fclose($jihu_f);
}
//极光
$url = "http://106.119.166.87:18702/api/agent/getList2?apikey=80cf4f64e990b78a9fc5eb";
$jiguang = json_decode(file_get_contents($url), true)['data'];
if ($jiguang) {
$jiguang_f = fopen(__DIR__ . '/data/jiguang.csv', 'w');
jiguang_getList($jiguang, $jiguang_f, $all);
fclose($jiguang_f);
}
$apikey = '80cf4f64e990b78a9fc5eb';
$url = "http://rds-api.juip.com/api/index/getList2?apikey=".$apikey;
$mogu = json_decode(file_get_contents($url), true)['data'];
@@ -74,6 +92,7 @@ if ($mogu) {
}
//麒麟动态
$dnx_has_exit = [];
$qilin = new jinyou();
@@ -89,60 +108,68 @@ if ($qilin_api_data) {
//猎豹
$liebao = json_decode(file_get_contents("https://xmapi.xingmojs.com/ppp/v1/areas?apiid=130&sendtime=" . time() . "&sign=" . md5('apiid=130&sendtime=' . time() . '3AT7XCHjWG8sSMpRBjtAJ8JRkSAbhJit')), true)['data'];
if($liebao){
$liebao_data = get_product(__DIR__ . '/data/liebao.csv');
$liebao_f = fopen(__DIR__ . '/data/liebao.csv', 'w');
//写入天天文件
liebao_getList($liebao, $liebao_f, $all, $liebao_data, '猎豹');
fclose($liebao_f);
$url = "http://106.119.166.87:18702/api/agent/getList2?apikey=80cf4f64e990b78a9fc5eb";
$liebao = json_decode(file_get_contents($url), true)['data'];
if ($liebao) {
$liebao_f = fopen(__DIR__ . '/data/liebao.csv', 'w');
liebao_getList($liebao, $liebao_f, $all);
fclose($liebao_f);
}
//先锋
$xianfeng = json_decode(file_get_contents("http://service.shenlongip.com/api/server/getlist"), true)['P'];
// $liebao = json_decode(file_get_contents("https://xmapi.xingmojs.com/ppp/v1/areas?apiid=130&sendtime=" . time() . "&sign=" . md5('apiid=130&sendtime=' . time() . '3AT7XCHjWG8sSMpRBjtAJ8JRkSAbhJit')), true)['data'];
// if($liebao){
// $liebao_data = get_product(__DIR__ . '/data/liebao.csv');
// $liebao_f = fopen(__DIR__ . '/data/liebao.csv', 'w');
// //写入天天文件
// liebao_getList($liebao, $liebao_f, $all, $liebao_data, '猎豹');
// fclose($liebao_f);
// }
// //先锋
// $xianfeng = json_decode(file_get_contents("http://service.shenlongip.com/api/server/getlist"), true)['P'];
if($xianfeng){
$xianfeng_data = get_product(__DIR__ . '/data/xianfeng.csv');
$xianfeng_f = fopen(__DIR__ . '/data/xianfeng.csv', 'w');
//写入先锋文件
xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data);
fclose($xianfeng_f);
}
// if($xianfeng){
// $xianfeng_data = get_product(__DIR__ . '/data/xianfeng.csv');
// $xianfeng_f = fopen(__DIR__ . '/data/xianfeng.csv', 'w');
// //写入先锋文件
// xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data);
// fclose($xianfeng_f);
// }
$time = time();
$noce = md5(time());
$apikey = 'a478ad5aa3079bbbef3cd45e2d55d61e';
$sign = md5($time.$noce.$apikey);
$url = "http://47.92.116.14:2222/api/getNodeList?agentid=admin1&ti=".$time."&nonce=".$noce."&sign=".$sign;
$qiangzi = json_decode(file_get_contents($url), true)['data'];
if(!empty($qiangzi)){
$qiangzi_data = get_product(__DIR__ . '/data/qiangzi.csv');
$qiangzi_f = fopen(__DIR__ . '/data/qiangzi.csv', 'w');
// $time = time();
// $noce = md5(time());
// $apikey = 'a478ad5aa3079bbbef3cd45e2d55d61e';
// $sign = md5($time.$noce.$apikey);
// $url = "http://47.92.116.14:2222/api/getNodeList?agentid=admin1&ti=".$time."&nonce=".$noce."&sign=".$sign;
// $qiangzi = json_decode(file_get_contents($url), true)['data'];
// if(!empty($qiangzi)){
// $qiangzi_data = get_product(__DIR__ . '/data/qiangzi.csv');
// $qiangzi_f = fopen(__DIR__ . '/data/qiangzi.csv', 'w');
//写入强子文件
qiangzi_getList($qiangzi, $qiangzi_f, $all, $qiangzi_data);
fclose($qiangzi_f);
}
// //写入强子文件
// qiangzi_getList($qiangzi, $qiangzi_f, $all, $qiangzi_data);
// fclose($qiangzi_f);
// }
$time = time();
$noce = md5(time());
$apikey = 'osoa917321hdjw';
$sign = md5($time.$noce.$apikey);
$url = "http://47.92.65.184:2223/api/getNodeList?agentid=admin2&ti=".$time."&nonce=".$noce."&sign=".$sign;
$xunlian = json_decode(file_get_contents($url), true)['data'];
// $xunlian = false;
if ($xunlian){
$xunlian_data = get_product(__DIR__ . '/data/xunlian.csv');
$xunlian_f = fopen(__DIR__ . '/data/xunlian.csv', 'w');
//写入讯连文件
xunlian_getList($xunlian, $xunlian_f, $all, $xunlian_data);
fclose($xunlian_f);
}
// $time = time();
// $noce = md5(time());
// $apikey = 'osoa917321hdjw';
// $sign = md5($time.$noce.$apikey);
// $url = "http://47.92.65.184:2223/api/getNodeList?agentid=admin2&ti=".$time."&nonce=".$noce."&sign=".$sign;
// $xunlian = json_decode(file_get_contents($url), true)['data'];
// // $xunlian = false;
// if ($xunlian){
// $xunlian_data = get_product(__DIR__ . '/data/xunlian.csv');
// $xunlian_f = fopen(__DIR__ . '/data/xunlian.csv', 'w');
// //写入讯连文件
// xunlian_getList($xunlian, $xunlian_f, $all, $xunlian_data);
// fclose($xunlian_f);
// }
///动态
$url = 'http://int.linghangsoft.net:8000/sysadmin/useradmin/lineapi_admin1.php?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf';
@@ -157,32 +184,32 @@ if(!empty($yunniu)){
fclose($yunniu_f);
}
$xigua = json_decode(file_get_contents("http://api.beikeip.com/serverlistyzip/"), true)['data'];
if($xigua){
$xigua_data = get_product(__DIR__ . '/data/xigua.csv');
$xigua_f = fopen(__DIR__ . '/data/xigua.csv', 'w');
//写入西瓜文件
jike_getList($xigua, $xigua_f, $all, $xigua_data, false);
fclose($xigua_f);
}
// $xigua = json_decode(file_get_contents("http://api.beikeip.com/serverlistyzip/"), true)['data'];
// if($xigua){
// $xigua_data = get_product(__DIR__ . '/data/xigua.csv');
// $xigua_f = fopen(__DIR__ . '/data/xigua.csv', 'w');
// //写入西瓜文件
// jike_getList($xigua, $xigua_f, $all, $xigua_data, false);
// fclose($xigua_f);
// }
$tiantian = json_decode(file_get_contents("https://yoyoapi.yoyoip.com/v1/areas?apiid=89&sendtime=" . time() . "&sign=" . md5('apiid=89&sendtime=' . time() . 'NFeK72yYXmPiGR86YeMCBRTWDxXkrQsd')), true)['data'];
if($tiantian){
$tiantian_data = get_product(__DIR__ . '/data/tiantian.csv');
$tiantian_f = fopen(__DIR__ . '/data/tiantian.csv', 'w');
//写入天天文件
tiantian_getList($tiantian, $tiantian_f, $all, $tiantian_data, '天天');
fclose($tiantian_f);
}
// $tiantian = json_decode(file_get_contents("https://yoyoapi.yoyoip.com/v1/areas?apiid=89&sendtime=" . time() . "&sign=" . md5('apiid=89&sendtime=' . time() . 'NFeK72yYXmPiGR86YeMCBRTWDxXkrQsd')), true)['data'];
// if($tiantian){
// $tiantian_data = get_product(__DIR__ . '/data/tiantian.csv');
// $tiantian_f = fopen(__DIR__ . '/data/tiantian.csv', 'w');
// //写入天天文件
// tiantian_getList($tiantian, $tiantian_f, $all, $tiantian_data, '天天');
// fclose($tiantian_f);
// }
$jike = json_decode(file_get_contents("http://api.beikeip.com/beikeiplist/"), true)['data'];
if($jike){
$jike_data = get_product(__DIR__ . '/data/jike.csv');
$jike_f = fopen(__DIR__ . '/data/jike.csv', 'w');
//写入极客文件
jike_getList($jike, $jike_f, $all, $jike_data);
fclose($jike_f);
}
// $jike = json_decode(file_get_contents("http://api.beikeip.com/beikeiplist/"), true)['data'];
// if($jike){
// $jike_data = get_product(__DIR__ . '/data/jike.csv');
// $jike_f = fopen(__DIR__ . '/data/jike.csv', 'w');
// //写入极客文件
// jike_getList($jike, $jike_f, $all, $jike_data);
// fclose($jike_f);
// }
//水滴
@@ -733,56 +760,56 @@ function tiantian_getList($data, &$file, &$all, $exit, $product_name)
}
//天天服务器解析规则
function liebao_getList($data, &$file, &$all, $exit, $product_name)
{
global $dnx_exit, $dnx_has_exit;
$status = ['故障', '正常'];
$key = '';
$list1 = [];
foreach ($data as $info) {
$record = [];
$record['name'] = $product_name;
$record['city'] = $info['name'];
$key = $record['city'];
$list1[$key][] = $record;
foreach ($info['areas'] as $v) {
// //天天服务器解析规则
// function liebao_getList($data, &$file, &$all, $exit, $product_name)
// {
// global $dnx_exit, $dnx_has_exit;
// $status = ['故障', '正常'];
// $key = '';
// $list1 = [];
// foreach ($data as $info) {
// $record = [];
// $record['name'] = $product_name;
// $record['city'] = $info['name'];
// $key = $record['city'];
// $list1[$key][] = $record;
// foreach ($info['areas'] as $v) {
if (strpos($v['name'], '电信') !== false) {
$record['city'] = $v['name'];
$record['supply'] = '电信';
} elseif (strpos($v['name'], '联通') !== false) {
$record['city'] = $v['name'];
$record['supply'] = '联通';
} elseif (strpos($v['name'], '移动') !== false) {
$record['city'] = $v['name'];
$record['supply'] = '移动';
} else {
$record['city'] = $v['name'];
$record['supply'] = '电信/联通';
}
$record['ip'] = '';
$record['daikuan'] = '';
$record['onlineuser'] = '';
$record['maxuser'] = '';
$record['online'] = empty($v['status']) ? '故障' : $status[$v['status']];
$record['status'] = '';
$record['nasname'] = $v['address'];
if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) {
fputcsv($dnx_exit, [$product_name, explode('.',$record['nasname'])[0], $record['nasname'], date('Y-m-d H:i:s')]);
}
$list1[$key][] = $record;
}
}
foreach ($list1 as $val) {
foreach ($val as $net_data) {
// if (strpos($v['name'], '电信') !== false) {
// $record['city'] = $v['name'];
// $record['supply'] = '电信';
// } elseif (strpos($v['name'], '联通') !== false) {
// $record['city'] = $v['name'];
// $record['supply'] = '联通';
// } elseif (strpos($v['name'], '移动') !== false) {
// $record['city'] = $v['name'];
// $record['supply'] = '移动';
// } else {
// $record['city'] = $v['name'];
// $record['supply'] = '电信/联通';
// }
// $record['ip'] = '';
// $record['daikuan'] = '';
// $record['onlineuser'] = '';
// $record['maxuser'] = '';
// $record['online'] = empty($v['status']) ? '故障' : $status[$v['status']];
// $record['status'] = '';
// $record['nasname'] = $v['address'];
// if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) {
// fputcsv($dnx_exit, [$product_name, explode('.',$record['nasname'])[0], $record['nasname'], date('Y-m-d H:i:s')]);
// }
// $list1[$key][] = $record;
// }
// }
// foreach ($list1 as $val) {
// foreach ($val as $net_data) {
fputcsv($file, $net_data);
fputcsv($all, $net_data);
}
}
// fputcsv($file, $net_data);
// fputcsv($all, $net_data);
// }
// }
}
// }
//蘑菇服务器解析规则
@@ -836,6 +863,161 @@ function mogu_getList($data, &$file, &$all )
}
//极狐服务器解析规则
function jihu_getList($data, &$file, &$all )
{
$key = '';
$list1 = [];
// print_r($data);
$province_record = [];
foreach ($data as $info) {
$record = [];
$record['name'] = '极狐';
//如果存在 不为空 则
$city_name = explode('-',$info['city']);
if(empty($info['city'])) {
continue;
}
//如果存在 不为空 则
if (!in_array( $city_name[0], $province_record)) {
$record['city'] = $city_name[0];
$province_record[] = $city_name[0];
$key = $record['city'];
$list1[$key][] = $record;
}
$key = $city_name[0];
$record['city'] = $city_name[1];
$record['supply'] = $info['yunying'];
$record['ip'] = $info['ipCount'];
$record['daikuan'] = $info['daikuan'];
$record['onlineuser'] = '';
$record['maxuser'] = '';
$record['online'] = $info['status'];
$record['status'] = $info['onlinestatus'];
$record['nasname'] = $info['address'];
$list1[$key][] = $record;
}
foreach ($list1 as $val) {
foreach ($val as $net_data) {
fputcsv($file, $net_data);
fputcsv($all, $net_data);
}
}
}
//极光服务器解析规则
function jiguang_getList($data, &$file, &$all )
{
$key = '';
$list1 = [];
// print_r($data);
$province_record = [];
foreach ($data as $info) {
$record = [];
$record['name'] = '极光';
//如果存在 不为空 则
$city_name = explode('-',$info['city']);
if(empty($info['city'])) {
continue;
}
//如果存在 不为空 则
if (!in_array( $city_name[0], $province_record)) {
$record['city'] = $city_name[0];
$province_record[] = $city_name[0];
$key = $record['city'];
$list1[$key][] = $record;
}
$key = $city_name[0];
$record['city'] = $city_name[1];
$record['supply'] = $info['yunying'];
$record['ip'] = $info['ipCount'];
$record['daikuan'] = $info['daikuan'];
$record['onlineuser'] = '';
$record['maxuser'] = '';
$record['online'] = $info['status'];
$record['status'] = $info['onlinestatus'];
$record['nasname'] = $info['address'];
$list1[$key][] = $record;
}
foreach ($list1 as $val) {
foreach ($val as $net_data) {
fputcsv($file, $net_data);
fputcsv($all, $net_data);
}
}
}
//极光服务器解析规则
function liebao_getList($data, &$file, &$all )
{
$key = '';
$list1 = [];
// print_r($data);
$province_record = [];
foreach ($data as $info) {
$record = [];
$record['name'] = '猎豹';
//如果存在 不为空 则
$city_name = explode('-',$info['city']);
if(empty($info['city'])) {
continue;
}
//如果存在 不为空 则
if (!in_array( $city_name[0], $province_record)) {
$record['city'] = $city_name[0];
$province_record[] = $city_name[0];
$key = $record['city'];
$list1[$key][] = $record;
}
$key = $city_name[0];
$record['city'] = $city_name[1];
$record['supply'] = $info['yunying'];
$record['ip'] = $info['ipCount'];
$record['daikuan'] = $info['daikuan'];
$record['onlineuser'] = '';
$record['maxuser'] = '';
$record['online'] = $info['status'];
$record['status'] = $info['onlinestatus'];
$record['nasname'] = $info['address'];
$list1[$key][] = $record;
}
foreach ($list1 as $val) {
foreach ($val as $net_data) {
fputcsv($file, $net_data);
fputcsv($all, $net_data);
}
}
}
//麒麟服务器解析规则
function qilin_getList($data, &$file, &$all, $exit )
{

View File

@@ -59,6 +59,12 @@ if($_GET['type'] == 1){
case 18:
search_product(__DIR__.'/data/download/mogu.csv','mgip.net');
break;
case 29:
search_product(__DIR__.'/data/download/jihu.csv','jhip.net');
break;
case 3:
search_product(__DIR__.'/data/download/jiguang.csv','jgip.cc');
break;
case 19:
search_product(__DIR__.'/data/download/huohu.csv','hhip.vip');
break;
@@ -145,6 +151,12 @@ function search_all_product($file_path,$search){
case '蘑菇':
$dns = 'mgip.net';
break;
case '极狐':
$dns = 'jhip.net';
break;
case '极光':
$dns = 'jgip.cc';
break;
case '火狐静态':
$dns = 'hhip.vip';
break;