Compare commits
3 Commits
master
...
de27a23b4f
| Author | SHA1 | Date | |
|---|---|---|---|
| de27a23b4f | |||
| 0db0f75db8 | |||
| 1ea7458c7b |
@@ -10,6 +10,7 @@ use app\jinyou\model\Package as PackageModel;
|
||||
use app\jinyou\model\PriceScheme as SchemeModel;
|
||||
use app\jinyou\model\UserPrice as UserPriceModel;
|
||||
use app\jinyou\model\ProductOrder as ProductOrderModel;
|
||||
use app\jinyou\model\ProductAccount as ProductAccountModel;
|
||||
use enum\order\ProductOrder as OrderEnum;
|
||||
use app\user\model\UserScore as UserScore;
|
||||
use app\jinyou\model\Account as AccountModel;
|
||||
@@ -74,11 +75,11 @@ class Jinyoujt extends Controller
|
||||
$user_model = new UserModel;
|
||||
$jinyoujingtai = new Jinyoujingtai;
|
||||
$package_model = new PackageModel;
|
||||
$product_account = new ProductAccountModel;
|
||||
$user_update_info = [];
|
||||
|
||||
$user_info = $user_model->getOne(['Id' => $this->userinfo['UserId']]);
|
||||
|
||||
|
||||
//套餐详情
|
||||
$package_info = $package_model->getOne(['Id' => $request_data['package_id']]);
|
||||
|
||||
@@ -117,6 +118,20 @@ class Jinyoujt extends Controller
|
||||
}
|
||||
|
||||
//判断账号是否存在
|
||||
$timezone = new DateTimeZone('Asia/Shanghai');
|
||||
$datetime = new DateTime('now', $timezone); // 确保是东八区时间
|
||||
$account_result = $product_account->getCount([
|
||||
'ProductId' => $package_info['ProductId'],
|
||||
'Account' => $request_data['account'],
|
||||
'EndTime' => ['>',$datetime->format('Y-m-d H:i:s')]
|
||||
])
|
||||
if($account_result['count'] > 0){
|
||||
$return_data['code'] = -1;
|
||||
$return_data['msg'] = "账号已经存在!";
|
||||
echo json_encode($return_data);
|
||||
die;
|
||||
}
|
||||
|
||||
$exist = $jinyoujingtai::checkVpnAccountExists($request_data['account'],$request_data['type']);
|
||||
if($exist->code != 200){
|
||||
$return_data['code'] = -1;
|
||||
|
||||
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";
|
||||
}
|
||||
@@ -16,19 +16,19 @@ return [
|
||||
|
||||
// 数据库连接
|
||||
'db' => [
|
||||
'host' => '127.0.0.1',
|
||||
'host' => 'mysql',
|
||||
'port' => 3306,
|
||||
'dbname' => 'hualianyun',
|
||||
'username' => 'root',
|
||||
'password' => 'qaz123!@#',
|
||||
'password' => '123456789',
|
||||
],
|
||||
// 线上数据库连接
|
||||
'formal_db' => [
|
||||
'host' => '127.0.0.1',
|
||||
'host' => 'mysql',
|
||||
'port' => 3306,
|
||||
'dbname' => 'hualianyun',
|
||||
'username' => 'root',
|
||||
'password' => 'qaz123!@#',
|
||||
'password' => '123456789',
|
||||
],
|
||||
//线上地址
|
||||
'formal_origin' => [
|
||||
@@ -58,7 +58,7 @@ return [
|
||||
'http://rg.jkip.com',
|
||||
'http://http.wyk',
|
||||
'http://taobao.juip.com',
|
||||
'http://register.wyk'
|
||||
'http://register.wyk',
|
||||
],
|
||||
//支付宝
|
||||
'alipay' => [
|
||||
|
||||
19
nginx.conf
19
nginx.conf
@@ -2,17 +2,6 @@ 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;
|
||||
|
||||
@@ -29,5 +18,13 @@ server {
|
||||
rewrite ^(.*)$ /index.php?s=$1 last;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
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;
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user