|
@@ -55,20 +55,20 @@ class RechargeController
|
|
if (is_json($data)) {
|
|
if (is_json($data)) {
|
|
$data = json_decode($data, true);
|
|
$data = json_decode($data, true);
|
|
}
|
|
}
|
|
- _syslog("APP充值","APP充值回调开始",$data,$data,1001);
|
|
|
|
|
|
+ _syslog("APP充值", "APP充值回调开始", $data, $data, 1001);
|
|
if (!$data['pay_id']) {
|
|
if (!$data['pay_id']) {
|
|
return json_fail('参数异常');
|
|
return json_fail('参数异常');
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
$result = $this->disposePaySuccess($data['pay_id']);
|
|
$result = $this->disposePaySuccess($data['pay_id']);
|
|
- _syslog("APP充值","APP处理完成",$data,$data,1001);
|
|
|
|
|
|
+ _syslog("APP充值", "APP处理完成", $data, $data, 1001);
|
|
|
|
|
|
return $result;
|
|
return $result;
|
|
- }catch(BusinessException $e){
|
|
|
|
- _syslog("APP充值","APP充值失败",$data,$data,1001);
|
|
|
|
|
|
+ } catch (BusinessException $e) {
|
|
|
|
+ _syslog("APP充值", "APP充值失败", $data, $data, 1001);
|
|
return json_fail("处理失败");
|
|
return json_fail("处理失败");
|
|
- }catch (\Exception $e){
|
|
|
|
- _syslog("APP充值","APP充值失败",$data,$data,1001);
|
|
|
|
|
|
+ } catch (\Exception $e) {
|
|
|
|
+ _syslog("APP充值", "APP充值失败", $data, $data, 1001);
|
|
return json_fail("处理失败");
|
|
return json_fail("处理失败");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -89,10 +89,11 @@ class RechargeController
|
|
* @return \support\Response
|
|
* @return \support\Response
|
|
* @throws BusinessException
|
|
* @throws BusinessException
|
|
*/
|
|
*/
|
|
- public function disposePaySuccess($payId){
|
|
|
|
|
|
+ public function disposePaySuccess($payId)
|
|
|
|
+ {
|
|
$payDetail = PayDetail::find($payId);
|
|
$payDetail = PayDetail::find($payId);
|
|
if (!$payDetail || $payDetail->pay_status != 'SUCCESS') {
|
|
if (!$payDetail || $payDetail->pay_status != 'SUCCESS') {
|
|
- throw new BusinessException("支付状态异常");
|
|
|
|
|
|
+ throw new BusinessException("支付状态异常");
|
|
// return json_fail("支付状态异常");
|
|
// return json_fail("支付状态异常");
|
|
}
|
|
}
|
|
$extendJson = [];
|
|
$extendJson = [];
|
|
@@ -113,9 +114,9 @@ class RechargeController
|
|
$addedNbr = 0;
|
|
$addedNbr = 0;
|
|
if (isset($objectJson['order_id'])) {
|
|
if (isset($objectJson['order_id'])) {
|
|
// 对应订单设置已完成
|
|
// 对应订单设置已完成
|
|
- Order::where('order_groupby',$payDetail->join_pay_order_id)->update(['order_status_system'=>'DONE','order_is_complete'=>'Y','order_status_storage'=>'DONE']);
|
|
|
|
|
|
+ Order::where('order_groupby', $payDetail->join_pay_order_id)->update(['order_status_system' => 'DONE', 'order_is_complete' => 'Y', 'order_status_storage' => 'DONE']);
|
|
$addedNbr = RechargeService::disposeOrder($objectJson['order_id']);
|
|
$addedNbr = RechargeService::disposeOrder($objectJson['order_id']);
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
// throw new BusinessException("支付数据异常");
|
|
// throw new BusinessException("支付数据异常");
|
|
// return json_fail("");
|
|
// return json_fail("");
|
|
@@ -131,19 +132,19 @@ class RechargeController
|
|
$memberAccount->member_account_income = $income;
|
|
$memberAccount->member_account_income = $income;
|
|
$memberAccount->member_account_surplus = $memberAccount->member_account_surplus + $payAmount;
|
|
$memberAccount->member_account_surplus = $memberAccount->member_account_surplus + $payAmount;
|
|
$memberAccount->save();
|
|
$memberAccount->save();
|
|
-
|
|
|
|
|
|
+
|
|
// 根据最新的数据,更新用户等级
|
|
// 根据最新的数据,更新用户等级
|
|
// 临时屏蔽该会员升级
|
|
// 临时屏蔽该会员升级
|
|
- if (!in_array($payDetail->join_pay_member_id,['MR2409132254Z9VW'])) {
|
|
|
|
- $member = Member::find($payDetail->join_pay_member_id);
|
|
|
|
- $roleId = RechargeService::disposeRole($payDetail->join_pay_member_id, $payDetail->pay_amount);
|
|
|
|
- if ($roleId && $member->join_member_role_id != $roleId) {
|
|
|
|
- $member->join_member_role_id = $roleId;
|
|
|
|
- $member->save();
|
|
|
|
- // 处理增值套包、组件
|
|
|
|
- RechargeService::disposeAdded($roleId, $payDetail->join_pay_member_id);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// if (!in_array($payDetail->join_pay_member_id, ['MR2409132254Z9VW'])) {
|
|
|
|
+// $member = Member::find($payDetail->join_pay_member_id);
|
|
|
|
+// $roleId = RechargeService::disposeRole($payDetail->join_pay_member_id, $payDetail->pay_amount);
|
|
|
|
+// if ($roleId && $member->join_member_role_id != $roleId) {
|
|
|
|
+// $member->join_member_role_id = $roleId;
|
|
|
|
+// $member->save();
|
|
|
|
+// // 处理增值套包、组件
|
|
|
|
+// RechargeService::disposeAdded($roleId, $payDetail->join_pay_member_id);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
Db::commit();
|
|
Db::commit();
|
|
|
|
|
|
return json_success('success');
|
|
return json_success('success');
|