|
@@ -326,24 +326,30 @@ class MonthOrderController extends Controller
|
|
$plan_id = $xml['plan_id'];
|
|
$plan_id = $xml['plan_id'];
|
|
$type = 'MONTH';
|
|
$type = 'MONTH';
|
|
$fee = 0;
|
|
$fee = 0;
|
|
|
|
+ $day = 0;
|
|
if($plan_id == env('MONTH_ORDER_PLAN_ID')){
|
|
if($plan_id == env('MONTH_ORDER_PLAN_ID')){
|
|
$fee = 3000;
|
|
$fee = 3000;
|
|
$type = 'MONTH';
|
|
$type = 'MONTH';
|
|
|
|
+ $day = 30;
|
|
}
|
|
}
|
|
|
|
|
|
if($plan_id == env('MONTH_WEEK_ORDER_PLAN_ID')){
|
|
if($plan_id == env('MONTH_WEEK_ORDER_PLAN_ID')){
|
|
$fee = 700;
|
|
$fee = 700;
|
|
$type = 'WEEK';
|
|
$type = 'WEEK';
|
|
|
|
+ $day = 7;
|
|
}
|
|
}
|
|
|
|
|
|
if($plan_id == env('MONTH_QUARTER_ORDER_PLAN_ID')){
|
|
if($plan_id == env('MONTH_QUARTER_ORDER_PLAN_ID')){
|
|
- $fee = 10000;
|
|
|
|
|
|
+ $fee = 9800;
|
|
$type = 'QUARTER';
|
|
$type = 'QUARTER';
|
|
|
|
+ $day = 92;
|
|
}
|
|
}
|
|
- //$fee = 1;
|
|
|
|
|
|
|
|
$user_id = $xml['contract_code'];
|
|
$user_id = $xml['contract_code'];
|
|
$change_type = $xml['change_type'];
|
|
$change_type = $xml['change_type'];
|
|
|
|
+ if (in_array($user_id, explode(',', env('TEST_UID')))) {
|
|
|
|
+ $fee = 1;
|
|
|
|
+ }
|
|
|
|
|
|
$user_info = UserService::getById($user_id);
|
|
$user_info = UserService::getById($user_id);
|
|
if (!$user_info) {
|
|
if (!$user_info) {
|
|
@@ -359,14 +365,18 @@ class MonthOrderController extends Controller
|
|
'change_type'=>$change_type,
|
|
'change_type'=>$change_type,
|
|
'operate_time'=>$xml['operate_time'],
|
|
'operate_time'=>$xml['operate_time'],
|
|
'contract_id'=>$xml['contract_id'],
|
|
'contract_id'=>$xml['contract_id'],
|
|
- 'contract_expired_time'=>$xml['contract_expired_time'],
|
|
|
|
|
|
+ 'contract_expired_time'=>isset($xml['contract_expired_time'])?$xml['contract_expired_time']:'',
|
|
'contract_termination_mode'=>isset($xml['contract_termination_mode'])?$xml['contract_termination_mode']:0,
|
|
'contract_termination_mode'=>isset($xml['contract_termination_mode'])?$xml['contract_termination_mode']:0,
|
|
'request_serial'=>$xml['request_serial']
|
|
'request_serial'=>$xml['request_serial']
|
|
|
|
|
|
]);
|
|
]);
|
|
UserMonthService::createSign($user_id, $plan_id, $change_type, $user_info->openid,$type);
|
|
UserMonthService::createSign($user_id, $plan_id, $change_type, $user_info->openid,$type);
|
|
if($change_type == 'ADD'){
|
|
if($change_type == 'ADD'){
|
|
- UserMonthService::monthPayApplypap($user_id,$xml['contract_id'],$fee,'追书云包季扣款','47.97.95.151','sign_back',\GuzzleHttp\json_encode(['uid'=>$user_id,'plan_id'=>$plan_id]));
|
|
|
|
|
|
+ //获取上次扣费时间
|
|
|
|
+ $info = UserMonthService::getLastMonthOrderInfo($user_id,$type);
|
|
|
|
+ if($info->isEmpty() || time() >= (strtotime($info->created_at)+$day*86400) ){
|
|
|
|
+ UserMonthService::monthPayApplypap($user_id,$xml['contract_id'],$fee,'追书云包季扣款','47.97.95.151','sign_back',\GuzzleHttp\json_encode(['uid'=>$user_id,'plan_id'=>$plan_id]));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
Log::info('signCallBack-------------------end-----------------------signCallBack');
|
|
Log::info('signCallBack-------------------end-----------------------signCallBack');
|
|
$result = ['return_code'=>'SUCCESS','return_msg'=>'OK'];
|
|
$result = ['return_code'=>'SUCCESS','return_msg'=>'OK'];
|