Compare commits
69 Commits
4db772e33b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c80725bb4a | ||
|
|
2efa163483 | ||
|
|
abb3584262 | ||
| 5a1d44095c | |||
| 2649b20dae | |||
| aea1718fd0 | |||
| 79641f01ee | |||
|
|
cbf3c44f14 | ||
|
|
79b0c7cf1c | ||
|
|
4dabfb1e4d | ||
|
|
9f0684addc | ||
|
|
4fd76358f2 | ||
|
|
6d96f15f95 | ||
|
|
28f4dcce32 | ||
|
|
392b680e75 | ||
|
|
48856a4d0e | ||
|
|
c324ca598a | ||
|
|
8092eea21c | ||
|
|
246a83bac4 | ||
|
|
272d5e6132 | ||
|
|
24a9b4a960 | ||
|
|
1a4dbef678 | ||
|
|
02c7af374b | ||
|
|
853e9d4855 | ||
|
|
9695c0114a | ||
|
|
bbf663365d | ||
|
|
73bce4e8f8 | ||
|
|
e81e23e0f1 | ||
|
|
2eae6b28f3 | ||
|
|
e44720fee6 | ||
|
|
3fd9a6ccba | ||
|
|
f537e28f8f | ||
|
|
784a3edb48 | ||
|
|
cf3a44235e | ||
|
|
3d5da26120 | ||
|
|
d5efeb8683 | ||
|
|
df98653c2c | ||
|
|
b788c754f5 | ||
|
|
1c9685eb89 | ||
|
|
20dfffd542 | ||
|
|
0a2600f9a6 | ||
|
|
c53518b1d1 | ||
|
|
b3c2ad57a8 | ||
|
|
4ae6a941cc | ||
|
|
2afea875ae | ||
|
|
90f7352d9c | ||
|
|
153b8a84c3 | ||
|
|
4f4533e119 | ||
|
|
36be468ac6 | ||
|
|
f0fe92ae20 | ||
|
|
e16e872a3a | ||
|
|
4e1e007ef7 | ||
|
|
4e955619a9 | ||
|
|
c9603421e4 | ||
|
|
7335d85062 | ||
|
|
45cc448c1f | ||
|
|
f04273024c | ||
|
|
b9bd680fb1 | ||
|
|
e77389d7a0 | ||
|
|
9e03ee42b6 | ||
|
|
e24f39e116 | ||
|
|
21e6268008 | ||
|
|
27241d8d81 | ||
|
|
e7d6e69d75 | ||
|
|
0c3cad4a6d | ||
|
|
36939effe3 | ||
|
|
37b7ac4c49 | ||
|
|
db9b9726eb | ||
|
|
900c68f02d |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1 +1,5 @@
|
|||||||
*.csv
|
*.csv
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
.volumes/
|
||||||
3
Dockerfile
Normal file
3
Dockerfile
Normal 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
|
||||||
@@ -24,8 +24,9 @@ class Agent extends Controller
|
|||||||
}
|
}
|
||||||
$where = [];
|
$where = [];
|
||||||
if(!empty($_GET['keyWord'])){
|
if(!empty($_GET['keyWord'])){
|
||||||
$where['username'] = $_GET['keyWord'];
|
$where = "username ='".$_GET['keyWord']."' OR phone='".$_GET['keyWord']."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$agent_user_model = new AgentUser;
|
$agent_user_model = new AgentUser;
|
||||||
$user_model = new UserModel;
|
$user_model = new UserModel;
|
||||||
$order_model = new ProductOrderModel;
|
$order_model = new ProductOrderModel;
|
||||||
|
|||||||
@@ -71,11 +71,19 @@ class Index
|
|||||||
$user_model = new UserModel();
|
$user_model = new UserModel();
|
||||||
$is_exit = $user_model->getOne(['Phone' => $phone]);
|
$is_exit = $user_model->getOne(['Phone' => $phone]);
|
||||||
if($is_exit) {
|
if($is_exit) {
|
||||||
$return_data = [
|
if ($is_exit['is_verify'] == 0) {
|
||||||
'code' => 0,
|
$data_user_old = [
|
||||||
'msg' => '用户已经存在'
|
'LoginCode' => $is_exit['LoginCode'].'-del',
|
||||||
];
|
'Phone' => $is_exit['Phone'].'-del',
|
||||||
echo json_encode($return_data);die;
|
];
|
||||||
|
|
||||||
|
$user_model->updateOne(['Id'=>$is_exit['Id']],$data_user_old);
|
||||||
|
}
|
||||||
|
// $return_data = [
|
||||||
|
// 'code' => 0,
|
||||||
|
// 'msg' => '用户已经存在'
|
||||||
|
// ];
|
||||||
|
// echo json_encode($return_data);die;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -165,16 +173,25 @@ class Index
|
|||||||
|
|
||||||
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
|
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
|
||||||
if ($has_user){
|
if ($has_user){
|
||||||
$info = [
|
if ($has_user['is_verify'] == 0) {
|
||||||
'Code' => 20000,
|
$data_user_old = [
|
||||||
'Data' => '',
|
'LoginCode' => $has_user['LoginCode'].'-del',
|
||||||
'Message' => '该账号或者手机号被注册了',
|
'Phone' => $has_user['Phone'].'-del',
|
||||||
];
|
];
|
||||||
echo json_encode($info);
|
|
||||||
die;
|
$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){
|
if ($has_user2){
|
||||||
$info = [
|
$info = [
|
||||||
'Code' => 30000,
|
'Code' => 30000,
|
||||||
@@ -197,6 +214,105 @@ class Index
|
|||||||
die;
|
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(){
|
private function getCred(){
|
||||||
$ak = "JDC_A3B38E573D7404F976472FB42F52";
|
$ak = "JDC_A3B38E573D7404F976472FB42F52";
|
||||||
$sk = "C9BAE98F49B42DA2DC02868A75AA3AD8";
|
$sk = "C9BAE98F49B42DA2DC02868A75AA3AD8";
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ class Score extends Controller
|
|||||||
$id = $agent_user_model->getOne(['username'=>$get_data['keyWord']])['id'];
|
$id = $agent_user_model->getOne(['username'=>$get_data['keyWord']])['id'];
|
||||||
$where['agent_id'] = $id;
|
$where['agent_id'] = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!empty($get_data['id'])){
|
||||||
|
$where['agent_id'] = $get_data['id'];
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($_GET['Btime'])){
|
if (!empty($_GET['Btime'])){
|
||||||
$date1 = date('Y-m-d', strtotime($_GET['Btime']));
|
$date1 = date('Y-m-d', strtotime($_GET['Btime']));
|
||||||
|
|||||||
@@ -10,9 +10,26 @@ class Account
|
|||||||
|
|
||||||
public function __construct ()
|
public function __construct ()
|
||||||
{
|
{
|
||||||
|
error_reporting(0);
|
||||||
|
ini_set('display_errors', 0);
|
||||||
|
|
||||||
if(empty($_GET['apikey'])){
|
if(empty($_GET['apikey'])){
|
||||||
die;
|
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
|
//查询账号信息 ?apikey=1232455165&product=5&account=test1231
|
||||||
public function queryAccount()
|
public function queryAccount()
|
||||||
@@ -42,6 +59,45 @@ class Account
|
|||||||
];
|
];
|
||||||
echo json_encode($return_data);
|
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
|
// /api/account/creeatTest?apikey=1232455165&product=5&package=61&account=test1231&pwd=123
|
||||||
public function createTest()
|
public function createTest()
|
||||||
@@ -84,6 +140,31 @@ class Account
|
|||||||
$data = $_GET;
|
$data = $_GET;
|
||||||
$url = 'https://juip.com/product/ApiCreateOrder';
|
$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(
|
$params = array(
|
||||||
"apikey" => $data['apikey'],
|
"apikey" => $data['apikey'],
|
||||||
"PackageId" => $data['package'],
|
"PackageId" => $data['package'],
|
||||||
@@ -207,4 +288,105 @@ class Account
|
|||||||
|
|
||||||
echo $result;
|
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' => '账号不存在']);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -36,4 +36,17 @@ class Index extends Controller
|
|||||||
];
|
];
|
||||||
echo json_encode($data);
|
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']);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -70,6 +70,10 @@ class Verify
|
|||||||
if (empty($data)) {
|
if (empty($data)) {
|
||||||
$data = json_decode(file_get_contents("php://input"), true);
|
$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'];
|
$url = "http://124.236.113.166:18702/api/agent/openIM/apikey/80cf4f64e990b78a9fc5eb/account/".$data['account'];
|
||||||
linkcurl($url,'GET',[],[],0);
|
linkcurl($url,'GET',[],[],0);
|
||||||
echo json_encode(['code'=>1,]);
|
echo json_encode(['code'=>1,]);
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ use app\jinyou\model\Account as AccountModel;
|
|||||||
use app\jinyou\model\Package as PackageModel;
|
use app\jinyou\model\Package as PackageModel;
|
||||||
use app\jinqiao\model\Order as JqOrderModel;
|
use app\jinqiao\model\Order as JqOrderModel;
|
||||||
use app\jinqiao\model\Key as KeyModel;
|
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 {
|
class Alipay {
|
||||||
@@ -161,6 +164,58 @@ class Alipay {
|
|||||||
$package_info['ProductName'] = $order_info['ProductName'];
|
$package_info['ProductName'] = $order_info['ProductName'];
|
||||||
$account_model->open_account($account_info,$user_info,$package_info);
|
$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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ use app\jinyou\model\Account as AccountModel;
|
|||||||
use app\jinyou\model\Package as PackageModel;
|
use app\jinyou\model\Package as PackageModel;
|
||||||
use app\jinqiao\model\Order as JqOrderModel;
|
use app\jinqiao\model\Order as JqOrderModel;
|
||||||
use app\jinqiao\model\Key as KeyModel;
|
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 {
|
class Wxpay {
|
||||||
@@ -144,6 +147,53 @@ class Wxpay {
|
|||||||
$account_model = new AccountModel;
|
$account_model = new AccountModel;
|
||||||
$account_model->open_account($account_info,$user_info,$package_info);
|
$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>
|
echo '<xml>
|
||||||
|
|||||||
@@ -308,7 +308,48 @@ class Order extends Controller
|
|||||||
|
|
||||||
switch ($data['order_type']) {
|
switch ($data['order_type']) {
|
||||||
case 2:
|
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;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$data['money'] = round(($data['data']['periodAmount'] * $price['price'] * $data['data']['ipAmount']),2);
|
$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)) {
|
if ($order_model->add($order_data)) {
|
||||||
$url = $http_url;
|
$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));
|
$http_data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
||||||
|
|
||||||
if ($http_data->s < 0) {
|
if ($http_data->s < 0) {
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>-1,
|
'code'=>-7,
|
||||||
'data' => '非法参数',
|
'data' => '非法参数',
|
||||||
'msg' => '请求后台失败,请联系客服!'
|
'msg' => '请求后台失败,请联系客服!'
|
||||||
];
|
];
|
||||||
@@ -369,7 +419,7 @@ class Order extends Controller
|
|||||||
|
|
||||||
if ($http_order_data->s < 0) {
|
if ($http_order_data->s < 0) {
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>-1,
|
'code'=>-8,
|
||||||
'data' => '非法参数',
|
'data' => '非法参数',
|
||||||
'msg' => '请求后台失败,请联系客服!'
|
'msg' => '请求后台失败,请联系客服!'
|
||||||
];
|
];
|
||||||
@@ -393,7 +443,7 @@ class Order extends Controller
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>-1,
|
'code'=>-6,
|
||||||
'data' => '非法参数',
|
'data' => '非法参数',
|
||||||
'msg' => '请求后台失败,请联系客服!'
|
'msg' => '请求后台失败,请联系客服!'
|
||||||
];
|
];
|
||||||
@@ -402,7 +452,7 @@ class Order extends Controller
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>-1,
|
'code'=>-5,
|
||||||
'data' => '非法参数',
|
'data' => '非法参数',
|
||||||
'msg' => '聚币不足!'
|
'msg' => '聚币不足!'
|
||||||
];
|
];
|
||||||
@@ -411,7 +461,7 @@ class Order extends Controller
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>-1,
|
'code'=>-4,
|
||||||
'data' => '非法参数',
|
'data' => '非法参数',
|
||||||
'msg' => '聚币不足!'
|
'msg' => '聚币不足!'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -8,16 +8,14 @@ use app\http\model\Order as OrderModel;
|
|||||||
use enum\http\Order as HttpOrderEnum;
|
use enum\http\Order as HttpOrderEnum;
|
||||||
use app\http\model\Recharge as RechargeModel;
|
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://sandbox.sgxz.cn';
|
||||||
private $url_root = 'https://merchant.sgxz.cn';
|
private $url_root = 'https://merchant.sgxz.cn';
|
||||||
|
|
||||||
private $http_user_info = [];
|
private $http_user_info = [];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct() {
|
||||||
{
|
parent::__construct('', '');
|
||||||
parent::__construct('','');
|
|
||||||
if (empty($this->userinfo['UserId'])) {
|
if (empty($this->userinfo['UserId'])) {
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
@@ -31,12 +29,12 @@ class User extends Controller
|
|||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
];
|
];
|
||||||
$url = $this->url_root.'/user/detail';
|
$url = $this->url_root . '/user/detail';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$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 = [
|
$user_data = [
|
||||||
'uid' => $this->http_user_info['sgUserId'],
|
'uid' => $this->http_user_info['sgUserId'],
|
||||||
'token' => $data->d->apiToken,
|
'token' => $data->d->apiToken,
|
||||||
@@ -74,7 +72,7 @@ class User extends Controller
|
|||||||
foreach ($list as &$info) {
|
foreach ($list as &$info) {
|
||||||
$info['pay_type'] = $pay_type[$info['pay_type']];
|
$info['pay_type'] = $pay_type[$info['pay_type']];
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode($list);
|
echo json_encode($list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,21 +81,21 @@ class User extends Controller
|
|||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'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);
|
$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->period,$data->d->packs->unlimited,$data->d->packs->usage);
|
$list = array_merge($data->d->packs->period, $data->d->packs->unlimited, $data->d->packs->usage);
|
||||||
|
|
||||||
foreach ($list as &$info) {
|
foreach ($list as &$info) {
|
||||||
$info->name = HttpOrderEnum::$package_type[ $info->planType];
|
$info->name = HttpOrderEnum::$package_type[$info->planType];
|
||||||
$info->durationType2 = $info->durationType;
|
$info->durationType2 = $info->durationType;
|
||||||
$info->durationType = HttpOrderEnum::$durationType[ $info->durationType];
|
$info->durationType = HttpOrderEnum::$durationType[$info->durationType];
|
||||||
$info->expireTime = date('Y-m-d H:i:s',$info->expireTime);
|
$info->expireTime = date('Y-m-d H:i:s', $info->expireTime);
|
||||||
$info->isExpired = $info->isExpired?'已过期':'未过期';
|
$info->isExpired = $info->isExpired ? '已过期' : '未过期';
|
||||||
$info->ipAmount = $info->ipAmount?:'无限量';
|
$info->ipAmount = $info->ipAmount ?: '无限量';
|
||||||
$info->remainingAmount = $info->remainingAmount?:'无限量';
|
$info->remainingAmount = $info->remainingAmount ?: '无限量';
|
||||||
}
|
}
|
||||||
|
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@@ -107,23 +105,22 @@ class User extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//短效全部套餐
|
//短效全部套餐
|
||||||
public function dx_order() {
|
public function dx_order() {
|
||||||
$order_model = new OrderModel();
|
$order_model = new OrderModel();
|
||||||
$order_where = [
|
$order_where = [
|
||||||
'package_type' => ['in',HttpOrderEnum::$package_list],
|
'package_type' => ['in', HttpOrderEnum::$package_list],
|
||||||
'order_status' => HttpOrderEnum::$pay_yes,
|
'order_status' => HttpOrderEnum::$pay_yes,
|
||||||
'user_id' => $this->userinfo['UserId']
|
'user_id' => $this->userinfo['UserId']
|
||||||
];
|
];
|
||||||
$order_list = $order_model->getListPage($order_where);
|
$order_list = $order_model->getListPage($order_where);
|
||||||
|
|
||||||
foreach ($order_list as &$info) {
|
foreach ($order_list as &$info) {
|
||||||
$info['order_type'] = HttpOrderEnum::$order_type[$info['order_type']];
|
$info['order_type'] = HttpOrderEnum::$order_type[$info['order_type']];
|
||||||
$info['package_type'] = HttpOrderEnum::$package_type[$info['package_type']];
|
$info['package_type'] = HttpOrderEnum::$package_type[$info['package_type']];
|
||||||
$info['durationType'] = HttpOrderEnum::$durationType[ $info['durationType']];
|
$info['durationType'] = HttpOrderEnum::$durationType[$info['durationType']];
|
||||||
}
|
}
|
||||||
|
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@@ -140,11 +137,11 @@ class User extends Controller
|
|||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'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);
|
$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 = [
|
$return_data = [
|
||||||
'code' => 1,
|
'code' => 1,
|
||||||
'data' => $data->d,
|
'data' => $data->d,
|
||||||
@@ -152,28 +149,27 @@ class User extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
//用户短效每日使用情况查询
|
//用户短效每日使用情况查询
|
||||||
public function dx_used_log() {
|
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 = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'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,
|
'limit' => 50,
|
||||||
'packType' => $request_data['packType'],
|
'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);
|
$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) {
|
foreach ($data->d->items as &$info) {
|
||||||
$info->packType = HttpOrderEnum::$package_type[$info->packType];
|
$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 = [
|
$return_data = [
|
||||||
'code' => 1,
|
'code' => 1,
|
||||||
@@ -182,14 +178,13 @@ class User extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//长效ip列表
|
//长效ip列表
|
||||||
public function lang_ip_list() {
|
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'];
|
$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) {
|
foreach ($request_data as $key => &$info) {
|
||||||
if (strlen($info) == 0) {
|
if (strlen($info) == 0) {
|
||||||
@@ -198,8 +193,8 @@ class User extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$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 = [
|
$line_status = [
|
||||||
'1' => '正常',
|
'1' => '正常',
|
||||||
@@ -209,10 +204,10 @@ class User extends Controller
|
|||||||
|
|
||||||
foreach ($data->d->items as &$info) {
|
foreach ($data->d->items as &$info) {
|
||||||
$info->lineType2 = $info->lineType;
|
$info->lineType2 = $info->lineType;
|
||||||
$info->lineType = ($info->lineType == 1)?'普通':'优质';
|
$info->lineType = ($info->lineType == 1) ? '普通' : '优质';
|
||||||
$info->expireTime = date('Y-m-d H:i:s',$info->expireTime);
|
$info->expireTime = date('Y-m-d H:i:s', $info->expireTime);
|
||||||
$info->shareType2 = $info->shareType;
|
$info->shareType2 = $info->shareType;
|
||||||
$info->shareType = ($info->shareType == 1)?'共享':'独享';
|
$info->shareType = ($info->shareType == 1) ? '共享' : '独享';
|
||||||
$info->state = $line_status[$info->state];
|
$info->state = $line_status[$info->state];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,25 +220,25 @@ class User extends Controller
|
|||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
//长效全部套餐
|
//长效全部套餐
|
||||||
public function cx_package() {
|
public function cx_package() {
|
||||||
$list = [];
|
$list = [];
|
||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'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);
|
$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);
|
$list = array_merge($data->d->packs);
|
||||||
|
|
||||||
foreach ($list as &$info) {
|
foreach ($list as &$info) {
|
||||||
$info->isAbroad2 = $info->isAbroad;
|
$info->isAbroad2 = $info->isAbroad;
|
||||||
$info->isAbroad = HttpOrderEnum::$game_type[ $info->isAbroad];
|
$info->isAbroad = HttpOrderEnum::$game_type[$info->isAbroad];
|
||||||
$info->expireTime = date('Y-m-d H:i:s',$info->expireTime);
|
$info->expireTime = date('Y-m-d H:i:s', $info->expireTime);
|
||||||
$info->isExpired = $info->isExpired?'已过期':'未过期';
|
$info->isExpired = $info->isExpired ? '已过期' : '未过期';
|
||||||
$info->shareType = ($info->shareType == 1) ?'共享':'独享';
|
$info->shareType = ($info->shareType == 1) ? '共享' : '独享';
|
||||||
}
|
}
|
||||||
|
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@@ -253,7 +248,6 @@ class User extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//长效全部订单
|
//长效全部订单
|
||||||
@@ -270,7 +264,7 @@ class User extends Controller
|
|||||||
foreach ($order_list as &$info) {
|
foreach ($order_list as &$info) {
|
||||||
$info['order_type'] = HttpOrderEnum::$order_type[$info['order_type']];
|
$info['order_type'] = HttpOrderEnum::$order_type[$info['order_type']];
|
||||||
$info['package_type'] = HttpOrderEnum::$package_type[$info['package_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 = [
|
$return_data = [
|
||||||
@@ -285,19 +279,19 @@ class User extends Controller
|
|||||||
//长效ip切换记录
|
//长效ip切换记录
|
||||||
public function cx_switch() {
|
public function cx_switch() {
|
||||||
ini_set('display_errors', 'off');
|
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 = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'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,
|
'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);
|
$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-收费手动切换
|
//切换原因,0-系统自动切换,1-失效手动切换,2-免费手动切换,5-管理员免费切换,6-收费手动切换
|
||||||
$reason = [
|
$reason = [
|
||||||
0 => '系统自动切换,1',
|
0 => '系统自动切换,1',
|
||||||
@@ -306,9 +300,9 @@ class User extends Controller
|
|||||||
5 => '管理员免费切换',
|
5 => '管理员免费切换',
|
||||||
6 => '收费手动切换',
|
6 => '收费手动切换',
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($data->d->items as &$info) {
|
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];
|
$info->reason = $reason[$info->reason];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,15 +321,15 @@ class User extends Controller
|
|||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'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);
|
$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;
|
$list = $data->d->items;
|
||||||
|
|
||||||
foreach ($list as &$info) {
|
foreach ($list as &$info) {
|
||||||
$info->isLocked = $info->isLocked?'已锁定':'未锁定';
|
$info->isLocked = $info->isLocked ? '已锁定' : '未锁定';
|
||||||
}
|
}
|
||||||
|
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@@ -349,15 +343,15 @@ class User extends Controller
|
|||||||
|
|
||||||
//用户创建白名单
|
//用户创建白名单
|
||||||
public function create_white_ip() {
|
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'];
|
$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);
|
$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 = [
|
$return_data = [
|
||||||
'code' => 1,
|
'code' => 1,
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
@@ -368,15 +362,15 @@ class User extends Controller
|
|||||||
|
|
||||||
//用户锁定ip
|
//用户锁定ip
|
||||||
public function lock_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'];
|
$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);
|
$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 = [
|
$return_data = [
|
||||||
'code' => 1,
|
'code' => 1,
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
@@ -387,15 +381,15 @@ class User extends Controller
|
|||||||
|
|
||||||
//用户删除ip
|
//用户删除ip
|
||||||
public function delete_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'];
|
$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);
|
$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 = [
|
$return_data = [
|
||||||
'code' => 1,
|
'code' => 1,
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
@@ -403,19 +397,170 @@ class User extends Controller
|
|||||||
|
|
||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
//提取长效ip
|
//提取长效ip
|
||||||
public function get_lang_ip(){
|
public function get_lang_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['ids'] = trim($request_data['ids'],',');
|
$request_data['ids'] = trim($request_data['ids'], ',');
|
||||||
|
|
||||||
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
$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);
|
$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,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class Package extends Model
|
|||||||
$where = $data['data'];
|
$where = $data['data'];
|
||||||
$where['package_type'] = HttpOrderEnum::$dxwxl;
|
$where['package_type'] = HttpOrderEnum::$dxwxl;
|
||||||
$where['periodAmount'] = 1;
|
$where['periodAmount'] = 1;
|
||||||
|
unset($where['maxWhitelist']);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$where = $data['data'];
|
$where = $data['data'];
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace app\jinyou\controller;
|
|||||||
|
|
||||||
use extend\jinyouapi\Jinyou;
|
use extend\jinyouapi\Jinyou;
|
||||||
use fastphp\base\Controller;
|
use fastphp\base\Controller;
|
||||||
|
use app\product\model\ProductAccount as AccountModel;
|
||||||
|
|
||||||
class Jinyoudt extends Controller
|
class Jinyoudt extends Controller
|
||||||
{
|
{
|
||||||
@@ -12,6 +13,23 @@ class Jinyoudt extends Controller
|
|||||||
if(!$data){
|
if(!$data){
|
||||||
die;
|
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();
|
$jinyou = new Jinyou();
|
||||||
$status = $jinyou::openTxLimit($data['account']);
|
$status = $jinyou::openTxLimit($data['account']);
|
||||||
echo json_encode(['Code'=>30000,]);
|
echo json_encode(['Code'=>30000,]);
|
||||||
|
|||||||
@@ -10,11 +10,15 @@ use app\jinyou\model\Package as PackageModel;
|
|||||||
use app\jinyou\model\PriceScheme as SchemeModel;
|
use app\jinyou\model\PriceScheme as SchemeModel;
|
||||||
use app\jinyou\model\UserPrice as UserPriceModel;
|
use app\jinyou\model\UserPrice as UserPriceModel;
|
||||||
use app\jinyou\model\ProductOrder as ProductOrderModel;
|
use app\jinyou\model\ProductOrder as ProductOrderModel;
|
||||||
|
use app\jinyou\model\ProductAccount as ProductAccountModel;
|
||||||
use enum\order\ProductOrder as OrderEnum;
|
use enum\order\ProductOrder as OrderEnum;
|
||||||
use app\user\model\UserScore as UserScore;
|
use app\user\model\UserScore as UserScore;
|
||||||
use app\jinyou\model\Account as AccountModel;
|
use app\jinyou\model\Account as AccountModel;
|
||||||
use extend\wechatpay\Wxpay;
|
use extend\wechatpay\Wxpay;
|
||||||
use extend\alipay\Alipay;
|
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
|
class Jinyoujt extends Controller
|
||||||
{
|
{
|
||||||
@@ -63,7 +67,7 @@ class Jinyoujt extends Controller
|
|||||||
//创建静态订单
|
//创建静态订单
|
||||||
public function create_order() {
|
public function create_order() {
|
||||||
$request_data = json_decode(file_get_contents("php://input"),true)['order_info'];
|
$request_data = json_decode(file_get_contents("php://input"),true)['order_info'];
|
||||||
|
|
||||||
$return_data['code'] = 0;
|
$return_data['code'] = 0;
|
||||||
|
|
||||||
$request_data['price'] = abs($request_data['price']);
|
$request_data['price'] = abs($request_data['price']);
|
||||||
@@ -71,11 +75,11 @@ class Jinyoujt extends Controller
|
|||||||
$user_model = new UserModel;
|
$user_model = new UserModel;
|
||||||
$jinyoujingtai = new Jinyoujingtai;
|
$jinyoujingtai = new Jinyoujingtai;
|
||||||
$package_model = new PackageModel;
|
$package_model = new PackageModel;
|
||||||
|
$product_account = new ProductAccountModel;
|
||||||
$user_update_info = [];
|
$user_update_info = [];
|
||||||
|
|
||||||
$user_info = $user_model->getOne(['Id' => $this->userinfo['UserId']]);
|
$user_info = $user_model->getOne(['Id' => $this->userinfo['UserId']]);
|
||||||
|
|
||||||
|
|
||||||
//套餐详情
|
//套餐详情
|
||||||
$package_info = $package_model->getOne(['Id' => $request_data['package_id']]);
|
$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']);
|
$exist = $jinyoujingtai::checkVpnAccountExists($request_data['account'],$request_data['type']);
|
||||||
if($exist->code != 200){
|
if($exist->code != 200){
|
||||||
$return_data['code'] = -1;
|
$return_data['code'] = -1;
|
||||||
@@ -142,11 +160,11 @@ class Jinyoujt extends Controller
|
|||||||
|
|
||||||
$order_enum = new OrderEnum;
|
$order_enum = new OrderEnum;
|
||||||
|
|
||||||
//判断新开类型
|
//判断新开类型
|
||||||
$OrderType = $order_enum::$New;
|
$OrderType = $order_enum::$New;
|
||||||
if ($request_data['buy_num'] > 1) {
|
if ($request_data['buy_num'] > 1) {
|
||||||
$OrderType = $order_enum::$News;
|
$OrderType = $order_enum::$News;
|
||||||
}
|
}
|
||||||
|
|
||||||
$OtherPayAmount = 0;
|
$OtherPayAmount = 0;
|
||||||
$AccountPayAmount = 0;
|
$AccountPayAmount = 0;
|
||||||
@@ -197,6 +215,7 @@ class Jinyoujt extends Controller
|
|||||||
'EndTime' => $endtime,
|
'EndTime' => $endtime,
|
||||||
'IsAutoRefund' => $product_info['AutoRefund'],
|
'IsAutoRefund' => $product_info['AutoRefund'],
|
||||||
'BackAmount' => 0,
|
'BackAmount' => 0,
|
||||||
|
'agent_id' => $user_info['agent_id'],
|
||||||
'remark2' => json_encode($request_data)
|
'remark2' => json_encode($request_data)
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -238,9 +257,56 @@ class Jinyoujt extends Controller
|
|||||||
$order_info['OrderState'] = $order_enum::$Complete;
|
$order_info['OrderState'] = $order_enum::$Complete;
|
||||||
//添加订单
|
//添加订单
|
||||||
$order_model->add($order_info);
|
$order_model->add($order_info);
|
||||||
|
|
||||||
$account_model = new AccountModel;
|
$account_model = new AccountModel;
|
||||||
$return_data = $account_model->open_account($request_data,$user_info,$package_info);
|
$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);
|
echo json_encode($return_data);
|
||||||
} else {
|
} else {
|
||||||
$return_data['code'] = -1;
|
$return_data['code'] = -1;
|
||||||
@@ -259,8 +325,8 @@ class Jinyoujt extends Controller
|
|||||||
];
|
];
|
||||||
//添加订单
|
//添加订单
|
||||||
$order_model->add($order_info);
|
$order_model->add($order_info);
|
||||||
|
|
||||||
|
|
||||||
$pay_html = Alipay::pay_jinyou($param);
|
$pay_html = Alipay::pay_jinyou($param);
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>2,
|
'code'=>2,
|
||||||
@@ -268,7 +334,7 @@ class Jinyoujt extends Controller
|
|||||||
];
|
];
|
||||||
echo json_encode($info);
|
echo json_encode($info);
|
||||||
} else if($request_data['pay_type'] == $order_enum::$Wechat) {
|
} else if($request_data['pay_type'] == $order_enum::$Wechat) {
|
||||||
|
|
||||||
$order_model->add($order_info);
|
$order_model->add($order_info);
|
||||||
//微信支付
|
//微信支付
|
||||||
$wxpay = new Wxpay();
|
$wxpay = new Wxpay();
|
||||||
@@ -321,7 +387,7 @@ class Jinyoujt extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$jinyoujingtai = new Jinyoujingtai;
|
$jinyoujingtai = new Jinyoujingtai;
|
||||||
|
|
||||||
$data = $jinyoujingtai::regionSurplusOuts($product_shuidi_id,$is_unshar,$game_id);
|
$data = $jinyoujingtai::regionSurplusOuts($product_shuidi_id,$is_unshar,$game_id);
|
||||||
|
|
||||||
echo json_encode($data);
|
echo json_encode($data);
|
||||||
@@ -331,19 +397,19 @@ class Jinyoujt extends Controller
|
|||||||
public function change_ip_list() {
|
public function change_ip_list() {
|
||||||
$info = json_decode(file_get_contents("php://input"),true)['data'];
|
$info = json_decode(file_get_contents("php://input"),true)['data'];
|
||||||
$jinyoujingtai = new Jinyoujingtai;
|
$jinyoujingtai = new Jinyoujingtai;
|
||||||
|
|
||||||
$data = $jinyoujingtai::switchIpList(121,$info['account'],$info['type']);
|
$data = $jinyoujingtai::switchIpList(121,$info['account'],$info['type']);
|
||||||
|
|
||||||
echo json_encode($data);
|
echo json_encode($data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//切换的ip
|
//切换的ip
|
||||||
public function change_ip() {
|
public function change_ip() {
|
||||||
$info = json_decode(file_get_contents("php://input"),true)['data'];
|
$info = json_decode(file_get_contents("php://input"),true)['data'];
|
||||||
$jinyoujingtai = new Jinyoujingtai;
|
$jinyoujingtai = new Jinyoujingtai;
|
||||||
|
|
||||||
$account_model = new AccountModel;
|
$account_model = new AccountModel;
|
||||||
$where = [
|
$where = [
|
||||||
'ProductId' => 28,
|
'ProductId' => 28,
|
||||||
@@ -355,21 +421,21 @@ class Jinyoujt extends Controller
|
|||||||
if ($info['chinge_addr']['rid'] != 0 ) {
|
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']);
|
$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 ) {
|
if ($info['chinge_ip']['ip_id'] != 0 ) {
|
||||||
$data = $jinyoujingtai::saveSwitchIp(121,$info['chinge_ip']['account'],$info['chinge_ip']['type'],$info['chinge_ip']['ip_id']);
|
$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']);
|
$shuidi_account_data = $jinyoujingtai::accountInfo(121,$info['chinge_ip']['account'],$info['chinge_ip']['type']);
|
||||||
|
|
||||||
$update_data = [
|
$update_data = [
|
||||||
'Remark' => $shuidi_account_data->data->region.$shuidi_account_data->data->address,
|
'Remark' => $shuidi_account_data->data->region.$shuidi_account_data->data->address,
|
||||||
'Raw' => $shuidi_account_data->data->inlet_website,
|
'Raw' => $shuidi_account_data->data->inlet_website,
|
||||||
];
|
];
|
||||||
$account_model->updateOne($where,$update_data);
|
$account_model->updateOne($where,$update_data);
|
||||||
|
|
||||||
echo json_encode(['code' => 1]);
|
echo json_encode(['code' => 1]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//解除屏蔽
|
//解除屏蔽
|
||||||
@@ -384,9 +450,27 @@ class Jinyoujt extends Controller
|
|||||||
if ($package[0] == '静态') {
|
if ($package[0] == '静态') {
|
||||||
$type = 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();
|
$jinyou = new Jinyoujingtai();
|
||||||
$status = $jinyou::setFirewallStatus($data['account'],$type,121);
|
$status = $jinyou::setFirewallStatus($data['account'],$type,121);
|
||||||
echo json_encode(['Code'=>30000,]);
|
echo json_encode(['Code'=>30000,]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ class Package extends Model
|
|||||||
if ($price < $package_price) {
|
if ($price < $package_price) {
|
||||||
$package['Price'] = $price;
|
$package['Price'] = $price;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($price > $package_price && $price < 1000000) {
|
||||||
|
$package['Price'] = $price;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($package_info[3])) {
|
if (isset($package_info[3])) {
|
||||||
|
|||||||
10
app/jinyou/model/ProductAccount.php
Normal file
10
app/jinyou/model/ProductAccount.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\jinyou\model;
|
||||||
|
|
||||||
|
use fastphp\base\Model;
|
||||||
|
|
||||||
|
class ProductAccount extends Model
|
||||||
|
{
|
||||||
|
protected $table = "product_account";
|
||||||
|
}
|
||||||
@@ -31,6 +31,10 @@ class UserPrice extends Model
|
|||||||
if ($price < $package_info['Price']) {
|
if ($price < $package_info['Price']) {
|
||||||
$package_info['Price'] = $price;
|
$package_info['Price'] = $price;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($price > $package_info['Price'] && $price < 100000) {
|
||||||
|
$package_info['Price'] = $price;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $package_info['Price'];
|
return $package_info['Price'];
|
||||||
|
|||||||
@@ -64,4 +64,34 @@ class Account extends Controller
|
|||||||
\result($count,'',30000);
|
\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,]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,20 +140,24 @@ class SellInfo extends Controller
|
|||||||
// $data['cost_not_mogu'] = "其他营业额($cost_not_mogu_data)";
|
// $data['cost_not_mogu'] = "其他营业额($cost_not_mogu_data)";
|
||||||
|
|
||||||
// $data['sell_percent'] = "我的营业额($user_cost)/总营业额($all_cost)=" . $sell_percent . '%';
|
// $data['sell_percent'] = "我的营业额($user_cost)/总营业额($all_cost)=" . $sell_percent . '%';
|
||||||
$data['other_order_active'] = "其他IP产品:" . $sell_money_list['other_order_1'];
|
$data['other_order_active'] = "合营IP产品:" . $sell_money_list['other_order_1'];
|
||||||
$data['mogu_order_active'] = "蘑菇IP产品:" . $sell_money_list['mogu_order_1'];
|
$data['self_order_active'] = "自营IP产品:" . $sell_money_list['self_order_1'];
|
||||||
$data['jihu_order_active'] = "极狐IP产品:" . $sell_money_list['jihu_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['recharge_active'] = "IP充值:" . $sell_money_list['recharge_1'];
|
||||||
$data['http_active'] = "HTTP充值:" . $sell_money_list['http_1'];
|
$data['http_active'] = "HTTP充值:" . $sell_money_list['http_1'];
|
||||||
$data['ros_active'] = "ROS订单:" . $sell_money_list['ros_1'];
|
$data['ros_active'] = "ROS订单:" . $sell_money_list['ros_1'];
|
||||||
$data['jinqiao_active'] = "金桥订单:" . $sell_money_list['jinqiao_1'];
|
$data['jinqiao_active'] = "" . $sell_money_list['jinqiao_1'];
|
||||||
$data['other_order_not_active'] = "其他IP产品:" . $sell_money_list['other_order_0'];
|
$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['self_order_not_active'] = "自营IP产品:" . $sell_money_list['self_order_0'];
|
||||||
$data['jihu_order_not_active'] = "极狐IP产品:" . $sell_money_list['jihu_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['recharge_not_active'] = "IP充值:" . $sell_money_list['recharge_0'];
|
||||||
$data['http_not_active'] = "HTTP充值:" . $sell_money_list['http_0'];
|
$data['http_not_active'] = "HTTP充值:" . $sell_money_list['http_0'];
|
||||||
$data['ros_not_active'] = "ROS订单:" . $sell_money_list['ros_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 . '%';
|
$data['cost_percent'] = "需维护的已消费客户($user_cost_num)/总的已消费客户($all_cost_num)=" . $cost_percent . '%';
|
||||||
@@ -291,23 +295,27 @@ class SellInfo extends Controller
|
|||||||
$cost_mogu_data = round($mogu_cost-$mogu_refund_cost,2);
|
$cost_mogu_data = round($mogu_cost-$mogu_refund_cost,2);
|
||||||
//其他营业额
|
//其他营业额
|
||||||
$cost_not_mogu_data = round($user_cost-$cost_mogu_data-$refund,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['other_order_active'] = "合营IP产品:" . $sell_money_list['other_order_1'];
|
||||||
$data['mogu_order_active'] = "蘑菇IP产品:" . $sell_money_list['mogu_order_1'];
|
$data['self_order_active'] = "自营IP产品:" . $sell_money_list['self_order_1'];
|
||||||
$data['jihu_order_active'] = "极狐IP产品:" . $sell_money_list['jihu_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['recharge_active'] = "IP充值:" . $sell_money_list['recharge_1'];
|
||||||
$data['http_active'] = "HTTP充值:" . $sell_money_list['http_1'];
|
$data['http_active'] = "HTTP充值:" . $sell_money_list['http_1'];
|
||||||
$data['ros_active'] = "ROS订单:" . $sell_money_list['ros_1'];
|
$data['ros_active'] = "ROS订单:" . $sell_money_list['ros_1'];
|
||||||
$data['jinqiao_active'] = "金桥订单:" . $sell_money_list['jinqiao_1'];
|
$data['jinqiao_active'] = "" . $sell_money_list['jinqiao_1'];
|
||||||
$data['other_order_not_active'] = "其他IP产品:" . $sell_money_list['other_order_0'];
|
$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['self_order_not_active'] = "自营IP产品:" . $sell_money_list['self_order_0'];
|
||||||
$data['jihu_order_not_active'] = "极狐IP产品:" . $sell_money_list['jihu_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['recharge_not_active'] = "IP充值:" . $sell_money_list['recharge_0'];
|
||||||
$data['http_not_active'] = "HTTP充值:" . $sell_money_list['http_0'];
|
$data['http_not_active'] = "HTTP充值:" . $sell_money_list['http_0'];
|
||||||
$data['ros_not_active'] = "ROS订单:" . $sell_money_list['ros_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_mogu'] = "蘑菇营业额($cost_mogu_data)";
|
||||||
$data['cost_not_mogu'] = "其他营业额($cost_not_mogu_data)";
|
// $data['cost_not_mogu'] = "其他营业额($cost_not_mogu_data)";
|
||||||
|
|
||||||
$data['sell_percent'] = "我的营业额($user_cost)/总营业额($all_cost)=" . $sell_percent . '%';
|
$data['sell_percent'] = "我的营业额($user_cost)/总营业额($all_cost)=" . $sell_percent . '%';
|
||||||
$data['cost_percent'] = "需维护的已消费客户($user_cost_num)/总的已消费客户($all_cost_num)=" . $cost_percent . '%';
|
$data['cost_percent'] = "需维护的已消费客户($user_cost_num)/总的已消费客户($all_cost_num)=" . $cost_percent . '%';
|
||||||
|
|||||||
@@ -281,7 +281,10 @@ class UserFollow extends Controller
|
|||||||
$info['op_user'] = $manager_info['RealName'];
|
$info['op_user'] = $manager_info['RealName'];
|
||||||
switch($info['product_type']) {
|
switch($info['product_type']) {
|
||||||
case 'other_order':
|
case 'other_order':
|
||||||
$info['product_type'] = '其他IP产品订单';
|
$info['product_type'] = '合营IP订单';
|
||||||
|
break;
|
||||||
|
case 'self_order':
|
||||||
|
$info['product_type'] = '自营IP订单';
|
||||||
break;
|
break;
|
||||||
case 'mogu_order':
|
case 'mogu_order':
|
||||||
$info['product_type'] = '蘑菇IP订单';
|
$info['product_type'] = '蘑菇IP订单';
|
||||||
@@ -290,6 +293,9 @@ class UserFollow extends Controller
|
|||||||
case 'jihu_order':
|
case 'jihu_order':
|
||||||
$info['product_type'] = '极狐IP订单';
|
$info['product_type'] = '极狐IP订单';
|
||||||
break;
|
break;
|
||||||
|
case 'jiguang_order':
|
||||||
|
$info['product_type'] = '极光IP订单';
|
||||||
|
break;
|
||||||
case 'recharge':
|
case 'recharge':
|
||||||
$info['product_type'] = 'IP充值';
|
$info['product_type'] = 'IP充值';
|
||||||
break;
|
break;
|
||||||
@@ -350,6 +356,10 @@ class UserFollow extends Controller
|
|||||||
}
|
}
|
||||||
$where .= " user_id=".$user_id['Id'].' ';
|
$where .= " user_id=".$user_id['Id'].' ';
|
||||||
}
|
}
|
||||||
|
if (!empty($where)) {
|
||||||
|
$where .= " AND ";
|
||||||
|
}
|
||||||
|
$where .= " op_user<>0".' ';
|
||||||
$list = $follow_rcord->getNewRecord($where,"$page,50");
|
$list = $follow_rcord->getNewRecord($where,"$page,50");
|
||||||
|
|
||||||
foreach ($list as &$info) {
|
foreach ($list as &$info) {
|
||||||
@@ -357,13 +367,20 @@ class UserFollow extends Controller
|
|||||||
$info['manager'] = $manager_id_list[$info['op_user']]['RealName'];
|
$info['manager'] = $manager_id_list[$info['op_user']]['RealName'];
|
||||||
switch($info['product_type']) {
|
switch($info['product_type']) {
|
||||||
case 'other_order':
|
case 'other_order':
|
||||||
$info['product_type'] = '其他IP产品订单';
|
$info['product_type'] = '合营IP订单';
|
||||||
|
break;
|
||||||
|
case 'self_order':
|
||||||
|
$info['product_type'] = '自营IP订单';
|
||||||
break;
|
break;
|
||||||
case 'mogu_order':
|
case 'mogu_order':
|
||||||
$info['product_type'] = '蘑菇IP订单';
|
$info['product_type'] = '蘑菇IP订单';
|
||||||
break;
|
break;
|
||||||
case 'jihu_order':
|
case 'jihu_order':
|
||||||
$info['product_type'] = '极狐IP订单';
|
$info['product_type'] = '极狐IP订单';
|
||||||
|
break;
|
||||||
|
case 'jiguang_order':
|
||||||
|
$info['product_type'] = '极光IP订单';
|
||||||
|
break;
|
||||||
case 'recharge':
|
case 'recharge':
|
||||||
$info['product_type'] = 'IP充值';
|
$info['product_type'] = 'IP充值';
|
||||||
break;
|
break;
|
||||||
@@ -461,7 +478,7 @@ class UserFollow extends Controller
|
|||||||
'sell_money' => 0,
|
'sell_money' => 0,
|
||||||
'sell_type' => 0,
|
'sell_type' => 0,
|
||||||
];
|
];
|
||||||
if ($data['product_type'] == 'other_order' || $data['product_type'] == 'mogu_order' || $data['product_type'] == 'jihu_order') {
|
if ($data['product_type'] == 'other_order' || $data['product_type'] == 'self_order' ) {
|
||||||
$sell_where = [
|
$sell_where = [
|
||||||
'UserId' => $data['user_id'],
|
'UserId' => $data['user_id'],
|
||||||
'PaymentAmount' => $data['sell_money'],
|
'PaymentAmount' => $data['sell_money'],
|
||||||
@@ -712,46 +729,44 @@ class UserFollow extends Controller
|
|||||||
\result($product_account_model->getUserAccount($id, $index));
|
\result($product_account_model->getUserAccount($id, $index));
|
||||||
}
|
}
|
||||||
|
|
||||||
//拨打电话进行维护
|
|
||||||
public function hujiao() {
|
public function hujiao() {
|
||||||
$data = json_decode(file_get_contents("php://input"), true);
|
$data = json_decode(file_get_contents("php://input"), true);
|
||||||
$phone = $data['phone'];
|
$phone = $data['phone'];
|
||||||
|
|
||||||
$callers = ['1017'=>'15225139515','1029'=>'15713870747','1030'=>'15111748058'];
|
$callers = ['1008'=>'17737957091','1029'=>'17737957091','1032'=>'17737957091'];
|
||||||
$operaterids = ['1017','1029','1030'];
|
$operaterids = ['1008','1029','1032'];
|
||||||
|
|
||||||
if (!in_array($this->userinfo['OperaterID'],$operaterids)) {
|
if (!in_array($this->userinfo['OperaterID'],$operaterids)) {
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
$caller = $callers[$this->userinfo['OperaterID']];
|
|
||||||
|
|
||||||
$callee = $phone;
|
$caller = $callers[$this->userinfo['OperaterID']];
|
||||||
$serviceNumber = '02361933764';
|
|
||||||
|
$callee = $phone;
|
||||||
$header = [
|
$serviceNumber = '';
|
||||||
'Content-Type:application/json',
|
|
||||||
'app_id:f39b78fb812f192e221b55b752267b2c',
|
$header = [
|
||||||
'timeStamp:'. time() * 1000
|
'Content-Type:application/json',
|
||||||
];
|
'app_id:f39b78fb812f192e221b55b752267b2c',
|
||||||
|
'timeStamp:'. time() * 1000
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
$param = [
|
$param = [
|
||||||
'caller' =>$caller,
|
'caller' =>$caller,
|
||||||
'callee'=>$callee,
|
'callee'=>$callee,
|
||||||
'serviceNumber'=>$serviceNumber,
|
'callBackUrl' =>"https://php-api.juip.com/api/hujiao/callback"
|
||||||
'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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,26 +102,26 @@ class CashOutAdmin extends Controller
|
|||||||
$cash_data = $cash->getOne(['id' => $id]);
|
$cash_data = $cash->getOne(['id' => $id]);
|
||||||
if ($data['status'] == '1') {
|
if ($data['status'] == '1') {
|
||||||
|
|
||||||
$param = [
|
// $param = [
|
||||||
'out_biz_no' => '2020' . time() . rand(10000, 99999),
|
// 'out_biz_no' => '2020' . time() . rand(10000, 99999),
|
||||||
'trans_amount' => $cash_data['money'],
|
// 'trans_amount' => $cash_data['money'],
|
||||||
'product_code' => 'TRANS_ACCOUNT_NO_PWD',
|
// 'product_code' => 'TRANS_ACCOUNT_NO_PWD',
|
||||||
'biz_scene' => 'DIRECT_TRANSFER',
|
// 'biz_scene' => 'DIRECT_TRANSFER',
|
||||||
'payee_info' => [
|
// 'payee_info' => [
|
||||||
'identity' => $cash_data['alipay_account'],
|
// 'identity' => $cash_data['alipay_account'],
|
||||||
'identity_type' => 'ALIPAY_LOGON_ID',
|
// 'identity_type' => 'ALIPAY_LOGON_ID',
|
||||||
'name' => $cash_data['real_name'],
|
// 'name' => $cash_data['real_name'],
|
||||||
],
|
// ],
|
||||||
'remark' => '聚IP提现-会员' . $cash_data['username'] . '-' . $cash_data['money'] . '元',
|
// 'remark' => '聚IP提现-会员' . $cash_data['username'] . '-' . $cash_data['money'] . '元',
|
||||||
];
|
// ];
|
||||||
$result = Alipay::transfer($param);
|
// $result = Alipay::transfer($param);
|
||||||
if ($result) {
|
// if ($result) {
|
||||||
$data['cash_no'] = $result->alipay_fund_trans_uni_transfer_response->out_biz_no;
|
// $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['alipay_no'] = $result->alipay_fund_trans_uni_transfer_response->order_id;
|
||||||
|
// $data['status'] = 1;
|
||||||
|
// } else {
|
||||||
$data['status'] = 1;
|
$data['status'] = 1;
|
||||||
} else {
|
// }
|
||||||
result([],'',30000);
|
|
||||||
}
|
|
||||||
} else if ($data['status'] == '2') {
|
} else if ($data['status'] == '2') {
|
||||||
if ($cash_data['is_agent'] != 1){
|
if ($cash_data['is_agent'] != 1){
|
||||||
$user_model = new UserModel;
|
$user_model = new UserModel;
|
||||||
|
|||||||
36
app/product/controller/Account.php
Normal file
36
app/product/controller/Account.php
Normal 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,]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace app\product\controller;
|
namespace app\product\controller;
|
||||||
|
|
||||||
use fastphp\base\Controller;
|
use fastphp\base\Controller;
|
||||||
|
use app\product\model\ProductAccount as AccountModel;
|
||||||
|
|
||||||
class OpenAccountLimit extends Controller
|
class OpenAccountLimit extends Controller
|
||||||
{
|
{
|
||||||
@@ -11,11 +12,24 @@ class OpenAccountLimit extends Controller
|
|||||||
if(!$data){
|
if(!$data){
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$where = [
|
||||||
|
'ProductId' => $data['productId'],
|
||||||
|
'DeleteTag' => 0,
|
||||||
|
'Account' => $data['account']
|
||||||
|
];
|
||||||
|
|
||||||
|
$account_model = new AccountModel;
|
||||||
|
|
||||||
|
$account_model->updateOne($where, ['im' => '1']);
|
||||||
|
|
||||||
// dump($data);die;
|
// dump($data);die;
|
||||||
if ($data['productId'] == 18) {
|
if ($data['productId'] == 18) {
|
||||||
$url = "http://rds-api.juip.com/api/agent/openIM/account/".$data['account'];
|
$url = "http://rds-api.juip.com/api/agent/openIM/account/".$data['account'];
|
||||||
} elseif ($data['productId'] == 29) {
|
} elseif ($data['productId'] == 29) {
|
||||||
$url = "http://124.236.113.166:18702/api/agent/openIM/apikey/80cf4f64e990b78a9fc5eb/account/".$data['account'];
|
$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);
|
linkcurl($url,'GET',[],[],0);
|
||||||
echo json_encode(['Code'=>30000,]);
|
echo json_encode(['Code'=>30000,]);
|
||||||
|
|||||||
@@ -107,16 +107,25 @@ class Index
|
|||||||
|
|
||||||
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
|
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
|
||||||
if ($has_user){
|
if ($has_user){
|
||||||
$info = [
|
if ($has_user['is_verify'] == 0) {
|
||||||
'Code' => 20000,
|
$data_user_old = [
|
||||||
'Data' => '',
|
'LoginCode' => $has_user['LoginCode'].'-del',
|
||||||
'Message' => '该账号或者手机号被注册了',
|
'Phone' => $has_user['Phone'].'-del',
|
||||||
];
|
];
|
||||||
echo json_encode($info);
|
|
||||||
die;
|
$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){
|
if ($has_user2){
|
||||||
$info = [
|
$info = [
|
||||||
'Code' => 30000,
|
'Code' => 30000,
|
||||||
|
|||||||
@@ -110,16 +110,25 @@ class Realname
|
|||||||
|
|
||||||
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
|
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
|
||||||
if ($has_user){
|
if ($has_user){
|
||||||
$info = [
|
if ($has_user['is_verify'] == 0) {
|
||||||
'Code' => 20000,
|
$data_user_old = [
|
||||||
'Data' => '',
|
'LoginCode' => $has_user['LoginCode'].'-del',
|
||||||
'Message' => '该账号或者手机号被注册了',
|
'Phone' => $has_user['Phone'].'-del',
|
||||||
];
|
];
|
||||||
echo json_encode($info);
|
|
||||||
die;
|
$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){
|
if ($has_user2){
|
||||||
$info = [
|
$info = [
|
||||||
'Code' => 30000,
|
'Code' => 30000,
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ return [
|
|||||||
'https://www.juip.com',
|
'https://www.juip.com',
|
||||||
'https://juip.com',
|
'https://juip.com',
|
||||||
'http://taobao.juip.com',
|
'http://taobao.juip.com',
|
||||||
|
'http://register.wyk'
|
||||||
],
|
],
|
||||||
// 跨域请求
|
// 跨域请求
|
||||||
'origin' => [
|
'origin' => [
|
||||||
@@ -57,6 +58,7 @@ return [
|
|||||||
'http://rg.jkip.com',
|
'http://rg.jkip.com',
|
||||||
'http://http.wyk',
|
'http://http.wyk',
|
||||||
'http://taobao.juip.com',
|
'http://taobao.juip.com',
|
||||||
|
'http://register.wyk'
|
||||||
],
|
],
|
||||||
//支付宝
|
//支付宝
|
||||||
'alipay' => [
|
'alipay' => [
|
||||||
|
|||||||
49
docker-compose.yaml
Normal file
49
docker-compose.yaml
Normal 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
|
||||||
@@ -36,7 +36,7 @@ class Sms
|
|||||||
$sendSmsRequest = new SendSmsRequest([
|
$sendSmsRequest = new SendSmsRequest([
|
||||||
"phoneNumbers" => $phone,
|
"phoneNumbers" => $phone,
|
||||||
"signName" => "华连云",
|
"signName" => "华连云",
|
||||||
"templateCode" => "SMS_186355045",
|
"templateCode" => "SMS_483310379",
|
||||||
"templateParam" => "{\"code\":\"$vcode\"}"
|
"templateParam" => "{\"code\":\"$vcode\"}"
|
||||||
]);
|
]);
|
||||||
// 复制代码运行请自行打印 API 的返回值
|
// 复制代码运行请自行打印 API 的返回值
|
||||||
@@ -62,7 +62,7 @@ class Sms
|
|||||||
$client = self::createClient("LTAI4FmSkDSwFuXeLxsDB3jB", "r8FfRmoeWcCJyZSqqkQP2G3dKPPl2N");
|
$client = self::createClient("LTAI4FmSkDSwFuXeLxsDB3jB", "r8FfRmoeWcCJyZSqqkQP2G3dKPPl2N");
|
||||||
$sendSmsRequest = new SendSmsRequest([
|
$sendSmsRequest = new SendSmsRequest([
|
||||||
"phoneNumbers" => $phone,
|
"phoneNumbers" => $phone,
|
||||||
"signName" => "聚IP",
|
"signName" => "河南华连网络科技",
|
||||||
"templateCode" => "SMS_462280213",
|
"templateCode" => "SMS_462280213",
|
||||||
"templateParam" => json_encode($data)
|
"templateParam" => json_encode($data)
|
||||||
]);
|
]);
|
||||||
@@ -89,7 +89,7 @@ class Sms
|
|||||||
$client = self::createClient("LTAI4FmSkDSwFuXeLxsDB3jB", "r8FfRmoeWcCJyZSqqkQP2G3dKPPl2N");
|
$client = self::createClient("LTAI4FmSkDSwFuXeLxsDB3jB", "r8FfRmoeWcCJyZSqqkQP2G3dKPPl2N");
|
||||||
$sendSmsRequest = new SendSmsRequest([
|
$sendSmsRequest = new SendSmsRequest([
|
||||||
"phoneNumbers" => $phone,
|
"phoneNumbers" => $phone,
|
||||||
"signName" => "聚IP商城",
|
"signName" => "河南华连网络科技",
|
||||||
"templateCode" => "SMS_463687988",
|
"templateCode" => "SMS_463687988",
|
||||||
"templateParam" => json_encode($data)
|
"templateParam" => json_encode($data)
|
||||||
]);
|
]);
|
||||||
|
|||||||
33
nginx.conf
Normal file
33
nginx.conf
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ $update_data = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
$where_month = [
|
$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);
|
$account_model->updateOne($where,$update_data);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function auto_format_list(){
|
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,29];
|
$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) {
|
foreach ($product_list as $product) {
|
||||||
switch ($product) {
|
switch ($product) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -72,6 +72,9 @@ function auto_format_list(){
|
|||||||
case 29:
|
case 29:
|
||||||
format_product(__DIR__ . '/data/jihu.csv','jhip.net');
|
format_product(__DIR__ . '/data/jihu.csv','jhip.net');
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
format_product(__DIR__ . '/data/jiguang.csv','jgip.cc');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,6 +134,9 @@ function format_all_product($file_path)
|
|||||||
case '极狐':
|
case '极狐':
|
||||||
$dns = 'jhip.net';
|
$dns = 'jhip.net';
|
||||||
break;
|
break;
|
||||||
|
case '极光':
|
||||||
|
$dns = 'jgip.cc';
|
||||||
|
break;
|
||||||
case '火狐静态':
|
case '火狐静态':
|
||||||
$dns = 'hhip.vip';
|
$dns = 'hhip.vip';
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ switch ($id) {
|
|||||||
case 29:
|
case 29:
|
||||||
get_product(__DIR__ . '/data/download/jihu.csv');
|
get_product(__DIR__ . '/data/download/jihu.csv');
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
get_product(__DIR__ . '/data/download/jiguang.csv');
|
||||||
|
break;
|
||||||
case 19:
|
case 19:
|
||||||
get_product(__DIR__ . '/data/download/huohu.csv');
|
get_product(__DIR__ . '/data/download/huohu.csv');
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -20,44 +20,42 @@ ini_set("display_errors", 0);
|
|||||||
|
|
||||||
// // //测试用----------------------------------------------------------------------------------------------------------
|
// // //测试用----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// $shuidi = new Jinyoujt;
|
//极光
|
||||||
|
// $url = "http://106.119.166.87:18702/api/agent/getList2?apikey=80cf4f64e990b78a9fc5eb";
|
||||||
// $url = "https://www.jyip.net/static-list";
|
// $jiguang = json_decode(file_get_contents($url), true)['data'];
|
||||||
// $shuidi_api_data = json_decode(file_get_contents($url),true)['data'];
|
// if ($jiguang) {
|
||||||
|
// $jiguang_f = fopen(__DIR__ . '/data/jiguang.csv', 'w');
|
||||||
// if ($shuidi_api_data) {
|
// jiguang_getList($jiguang, $jiguang_f, $all);
|
||||||
// $shuidi_data = get_product(__DIR__ . '/data/shuidi.csv');
|
// fclose($jiguang_f);
|
||||||
// $shuidi_f = fopen(__DIR__ . '/data/shuidi.csv', 'w');
|
|
||||||
// shuidi_getList($shuidi_api_data, $shuidi_f, $all,$shuidi_data);
|
|
||||||
// fclose($shuidi_f);
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// die;
|
// die;
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
$dnx_has_exit = [];
|
$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_json = json_decode(substr($sp_xl_code,3),true);
|
||||||
$sp_xl_list = [];
|
// $sp_xl_list = [];
|
||||||
foreach($sp_xl_json as $k=>$v){
|
// foreach($sp_xl_json as $k=>$v){
|
||||||
$temp = explode('-',$k);
|
// $temp = explode('-',$k);
|
||||||
$sp_xl_list[$temp[1]] = $v;
|
// $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_json = json_decode(substr($sp_qz_code,3),true);
|
||||||
$sp_qz_list = [];
|
// $sp_qz_list = [];
|
||||||
foreach($sp_qz_json as $k=>$v){
|
// foreach($sp_qz_json as $k=>$v){
|
||||||
$temp = explode('-',$k);
|
// $temp = explode('-',$k);
|
||||||
$sp_qz_list[$temp[1]] = $v;
|
// $sp_qz_list[$temp[1]] = $v;
|
||||||
}
|
// }
|
||||||
//--------------------------------------------
|
//--------------------------------------------
|
||||||
|
|
||||||
$all = fopen(__DIR__ . '/data/all.csv', 'w');
|
$all = fopen(__DIR__ . '/data/all.csv', 'w');
|
||||||
@@ -74,6 +72,15 @@ if ($jihu) {
|
|||||||
fclose($jihu_f);
|
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';
|
$apikey = '80cf4f64e990b78a9fc5eb';
|
||||||
$url = "http://rds-api.juip.com/api/index/getList2?apikey=".$apikey;
|
$url = "http://rds-api.juip.com/api/index/getList2?apikey=".$apikey;
|
||||||
@@ -101,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'];
|
$url = "http://106.119.166.87:18702/api/agent/getList2?apikey=80cf4f64e990b78a9fc5eb";
|
||||||
|
$liebao = json_decode(file_get_contents($url), true)['data'];
|
||||||
if($liebao){
|
if ($liebao) {
|
||||||
$liebao_data = get_product(__DIR__ . '/data/liebao.csv');
|
$liebao_f = fopen(__DIR__ . '/data/liebao.csv', 'w');
|
||||||
$liebao_f = fopen(__DIR__ . '/data/liebao.csv', 'w');
|
liebao_getList($liebao, $liebao_f, $all);
|
||||||
//写入天天文件
|
fclose($liebao_f);
|
||||||
liebao_getList($liebao, $liebao_f, $all, $liebao_data, '猎豹');
|
|
||||||
fclose($liebao_f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//先锋
|
// $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'];
|
||||||
$xianfeng = json_decode(file_get_contents("http://service.shenlongip.com/api/server/getlist"), true)['P'];
|
|
||||||
|
// 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){
|
// if($xianfeng){
|
||||||
$xianfeng_data = get_product(__DIR__ . '/data/xianfeng.csv');
|
// $xianfeng_data = get_product(__DIR__ . '/data/xianfeng.csv');
|
||||||
$xianfeng_f = fopen(__DIR__ . '/data/xianfeng.csv', 'w');
|
// $xianfeng_f = fopen(__DIR__ . '/data/xianfeng.csv', 'w');
|
||||||
//写入先锋文件
|
// //写入先锋文件
|
||||||
xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data);
|
// xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data);
|
||||||
fclose($xianfeng_f);
|
// fclose($xianfeng_f);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$time = time();
|
// $time = time();
|
||||||
$noce = md5(time());
|
// $noce = md5(time());
|
||||||
$apikey = 'a478ad5aa3079bbbef3cd45e2d55d61e';
|
// $apikey = 'a478ad5aa3079bbbef3cd45e2d55d61e';
|
||||||
$sign = md5($time.$noce.$apikey);
|
// $sign = md5($time.$noce.$apikey);
|
||||||
$url = "http://47.92.116.14:2222/api/getNodeList?agentid=admin1&ti=".$time."&nonce=".$noce."&sign=".$sign;
|
// $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'];
|
// $qiangzi = json_decode(file_get_contents($url), true)['data'];
|
||||||
if(!empty($qiangzi)){
|
// if(!empty($qiangzi)){
|
||||||
$qiangzi_data = get_product(__DIR__ . '/data/qiangzi.csv');
|
// $qiangzi_data = get_product(__DIR__ . '/data/qiangzi.csv');
|
||||||
$qiangzi_f = fopen(__DIR__ . '/data/qiangzi.csv', 'w');
|
// $qiangzi_f = fopen(__DIR__ . '/data/qiangzi.csv', 'w');
|
||||||
|
|
||||||
//写入强子文件
|
// //写入强子文件
|
||||||
qiangzi_getList($qiangzi, $qiangzi_f, $all, $qiangzi_data);
|
// qiangzi_getList($qiangzi, $qiangzi_f, $all, $qiangzi_data);
|
||||||
fclose($qiangzi_f);
|
// fclose($qiangzi_f);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
$time = time();
|
// $time = time();
|
||||||
$noce = md5(time());
|
// $noce = md5(time());
|
||||||
$apikey = 'osoa917321hdjw';
|
// $apikey = 'osoa917321hdjw';
|
||||||
$sign = md5($time.$noce.$apikey);
|
// $sign = md5($time.$noce.$apikey);
|
||||||
$url = "http://47.92.65.184:2223/api/getNodeList?agentid=admin2&ti=".$time."&nonce=".$noce."&sign=".$sign;
|
// $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 = json_decode(file_get_contents($url), true)['data'];
|
||||||
// $xunlian = false;
|
// // $xunlian = false;
|
||||||
if ($xunlian){
|
// if ($xunlian){
|
||||||
$xunlian_data = get_product(__DIR__ . '/data/xunlian.csv');
|
// $xunlian_data = get_product(__DIR__ . '/data/xunlian.csv');
|
||||||
$xunlian_f = fopen(__DIR__ . '/data/xunlian.csv', 'w');
|
// $xunlian_f = fopen(__DIR__ . '/data/xunlian.csv', 'w');
|
||||||
//写入讯连文件
|
// //写入讯连文件
|
||||||
xunlian_getList($xunlian, $xunlian_f, $all, $xunlian_data);
|
// xunlian_getList($xunlian, $xunlian_f, $all, $xunlian_data);
|
||||||
fclose($xunlian_f);
|
// fclose($xunlian_f);
|
||||||
}
|
// }
|
||||||
|
|
||||||
///动态
|
///动态
|
||||||
$url = 'http://int.linghangsoft.net:8000/sysadmin/useradmin/lineapi_admin1.php?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf';
|
$url = 'http://int.linghangsoft.net:8000/sysadmin/useradmin/lineapi_admin1.php?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf';
|
||||||
@@ -169,32 +184,32 @@ if(!empty($yunniu)){
|
|||||||
fclose($yunniu_f);
|
fclose($yunniu_f);
|
||||||
}
|
}
|
||||||
|
|
||||||
$xigua = json_decode(file_get_contents("http://api.beikeip.com/serverlistyzip/"), true)['data'];
|
// $xigua = json_decode(file_get_contents("http://api.beikeip.com/serverlistyzip/"), true)['data'];
|
||||||
if($xigua){
|
// if($xigua){
|
||||||
$xigua_data = get_product(__DIR__ . '/data/xigua.csv');
|
// $xigua_data = get_product(__DIR__ . '/data/xigua.csv');
|
||||||
$xigua_f = fopen(__DIR__ . '/data/xigua.csv', 'w');
|
// $xigua_f = fopen(__DIR__ . '/data/xigua.csv', 'w');
|
||||||
//写入西瓜文件
|
// //写入西瓜文件
|
||||||
jike_getList($xigua, $xigua_f, $all, $xigua_data, false);
|
// jike_getList($xigua, $xigua_f, $all, $xigua_data, false);
|
||||||
fclose($xigua_f);
|
// 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'];
|
// $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){
|
// if($tiantian){
|
||||||
$tiantian_data = get_product(__DIR__ . '/data/tiantian.csv');
|
// $tiantian_data = get_product(__DIR__ . '/data/tiantian.csv');
|
||||||
$tiantian_f = fopen(__DIR__ . '/data/tiantian.csv', 'w');
|
// $tiantian_f = fopen(__DIR__ . '/data/tiantian.csv', 'w');
|
||||||
//写入天天文件
|
// //写入天天文件
|
||||||
tiantian_getList($tiantian, $tiantian_f, $all, $tiantian_data, '天天');
|
// tiantian_getList($tiantian, $tiantian_f, $all, $tiantian_data, '天天');
|
||||||
fclose($tiantian_f);
|
// fclose($tiantian_f);
|
||||||
}
|
// }
|
||||||
|
|
||||||
$jike = json_decode(file_get_contents("http://api.beikeip.com/beikeiplist/"), true)['data'];
|
// $jike = json_decode(file_get_contents("http://api.beikeip.com/beikeiplist/"), true)['data'];
|
||||||
if($jike){
|
// if($jike){
|
||||||
$jike_data = get_product(__DIR__ . '/data/jike.csv');
|
// $jike_data = get_product(__DIR__ . '/data/jike.csv');
|
||||||
$jike_f = fopen(__DIR__ . '/data/jike.csv', 'w');
|
// $jike_f = fopen(__DIR__ . '/data/jike.csv', 'w');
|
||||||
//写入极客文件
|
// //写入极客文件
|
||||||
jike_getList($jike, $jike_f, $all, $jike_data);
|
// jike_getList($jike, $jike_f, $all, $jike_data);
|
||||||
fclose($jike_f);
|
// fclose($jike_f);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
//水滴
|
//水滴
|
||||||
@@ -745,56 +760,56 @@ function tiantian_getList($data, &$file, &$all, $exit, $product_name)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//天天服务器解析规则
|
// //天天服务器解析规则
|
||||||
function liebao_getList($data, &$file, &$all, $exit, $product_name)
|
// function liebao_getList($data, &$file, &$all, $exit, $product_name)
|
||||||
{
|
// {
|
||||||
global $dnx_exit, $dnx_has_exit;
|
// global $dnx_exit, $dnx_has_exit;
|
||||||
$status = ['故障', '正常'];
|
// $status = ['故障', '正常'];
|
||||||
$key = '';
|
// $key = '';
|
||||||
$list1 = [];
|
// $list1 = [];
|
||||||
foreach ($data as $info) {
|
// foreach ($data as $info) {
|
||||||
$record = [];
|
// $record = [];
|
||||||
$record['name'] = $product_name;
|
// $record['name'] = $product_name;
|
||||||
$record['city'] = $info['name'];
|
// $record['city'] = $info['name'];
|
||||||
$key = $record['city'];
|
// $key = $record['city'];
|
||||||
$list1[$key][] = $record;
|
// $list1[$key][] = $record;
|
||||||
foreach ($info['areas'] as $v) {
|
// foreach ($info['areas'] as $v) {
|
||||||
|
|
||||||
if (strpos($v['name'], '电信') !== false) {
|
// if (strpos($v['name'], '电信') !== false) {
|
||||||
$record['city'] = $v['name'];
|
// $record['city'] = $v['name'];
|
||||||
$record['supply'] = '电信';
|
// $record['supply'] = '电信';
|
||||||
} elseif (strpos($v['name'], '联通') !== false) {
|
// } elseif (strpos($v['name'], '联通') !== false) {
|
||||||
$record['city'] = $v['name'];
|
// $record['city'] = $v['name'];
|
||||||
$record['supply'] = '联通';
|
// $record['supply'] = '联通';
|
||||||
} elseif (strpos($v['name'], '移动') !== false) {
|
// } elseif (strpos($v['name'], '移动') !== false) {
|
||||||
$record['city'] = $v['name'];
|
// $record['city'] = $v['name'];
|
||||||
$record['supply'] = '移动';
|
// $record['supply'] = '移动';
|
||||||
} else {
|
// } else {
|
||||||
$record['city'] = $v['name'];
|
// $record['city'] = $v['name'];
|
||||||
$record['supply'] = '电信/联通';
|
// $record['supply'] = '电信/联通';
|
||||||
}
|
// }
|
||||||
$record['ip'] = '';
|
// $record['ip'] = '';
|
||||||
$record['daikuan'] = '';
|
// $record['daikuan'] = '';
|
||||||
$record['onlineuser'] = '';
|
// $record['onlineuser'] = '';
|
||||||
$record['maxuser'] = '';
|
// $record['maxuser'] = '';
|
||||||
$record['online'] = empty($v['status']) ? '故障' : $status[$v['status']];
|
// $record['online'] = empty($v['status']) ? '故障' : $status[$v['status']];
|
||||||
$record['status'] = '';
|
// $record['status'] = '';
|
||||||
$record['nasname'] = $v['address'];
|
// $record['nasname'] = $v['address'];
|
||||||
if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) {
|
// 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')]);
|
// fputcsv($dnx_exit, [$product_name, explode('.',$record['nasname'])[0], $record['nasname'], date('Y-m-d H:i:s')]);
|
||||||
}
|
// }
|
||||||
$list1[$key][] = $record;
|
// $list1[$key][] = $record;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
foreach ($list1 as $val) {
|
// foreach ($list1 as $val) {
|
||||||
foreach ($val as $net_data) {
|
// foreach ($val as $net_data) {
|
||||||
|
|
||||||
fputcsv($file, $net_data);
|
// fputcsv($file, $net_data);
|
||||||
fputcsv($all, $net_data);
|
// fputcsv($all, $net_data);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
//蘑菇服务器解析规则
|
//蘑菇服务器解析规则
|
||||||
@@ -899,6 +914,110 @@ function jihu_getList($data, &$file, &$all )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//极光服务器解析规则
|
||||||
|
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 )
|
function qilin_getList($data, &$file, &$all, $exit )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ if($_GET['type'] == 1){
|
|||||||
case 29:
|
case 29:
|
||||||
search_product(__DIR__.'/data/download/jihu.csv','jhip.net');
|
search_product(__DIR__.'/data/download/jihu.csv','jhip.net');
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
search_product(__DIR__.'/data/download/jiguang.csv','jgip.cc');
|
||||||
|
break;
|
||||||
case 19:
|
case 19:
|
||||||
search_product(__DIR__.'/data/download/huohu.csv','hhip.vip');
|
search_product(__DIR__.'/data/download/huohu.csv','hhip.vip');
|
||||||
break;
|
break;
|
||||||
@@ -151,6 +154,9 @@ function search_all_product($file_path,$search){
|
|||||||
case '极狐':
|
case '极狐':
|
||||||
$dns = 'jhip.net';
|
$dns = 'jhip.net';
|
||||||
break;
|
break;
|
||||||
|
case '极光':
|
||||||
|
$dns = 'jgip.cc';
|
||||||
|
break;
|
||||||
case '火狐静态':
|
case '火狐静态':
|
||||||
$dns = 'hhip.vip';
|
$dns = 'hhip.vip';
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user