getFile(), $e->getLine(), $e->getMessage() ])); self::setError($e->getMessage()); return $e->getMessage(); } } /** * @notes 充值回调 * @param $orderSn * @param array $extra * @author 段誉 * @date 2023/2/27 15:28 */ public static function recharge($orderSn, $extra = []) { $order = RechargeOrder::where('sn', $orderSn)->findOrEmpty(); if ($order && isset($order['extend']['type']) && $order['extend']['type'] == 1) { // ***** 小组服务团队-入股任务逻辑 已废弃 ***** $find = Task::where('id', $order['extend']['task_id'])->find(); $extend=$find['extend']; $extend['shareholder']['order_sn']=$order->sn; Task::where('id', $order['extend']['task_id'])->update(['status' => 3,'extend'=>json_encode($extend)]); TaskTemplate::where('id', $find['template_id'])->update(['over_decimal' => $order->order_amount]); } else { if($order['change_type']==300){ $company=Company::where('user_id',$order['user_id'])->find(); $left_amount= $company['deposit']+$order->order_amount; $datas = [ 'sn' => $order->sn, 'user_id' => $order->user_id, 'company_id' => $company['id']??0, 'change_type' => CompanyAccountLog::COMPANY_DEPOSIT, 'change_object' => CompanyAccountLog::DEPOSIT, 'action' => 1, 'change_amount' => $order->order_amount, 'left_amount' =>$left_amount, 'remark' => '押金充值', ]; CompanyAccountLog::create($datas); Company::where('id',$company['id'])->update(['deposit'=>$left_amount]); }else{ // 增加用户累计充值金额及用户余额 $user = User::findOrEmpty($order->user_id); $user->total_recharge_amount += $order->order_amount; $user->user_money += $order->order_amount; $user->save(); // 记录账户流水 AccountLogLogic::add( $order->user_id, AccountLogEnum::UM_INC_RECHARGE, AccountLogEnum::INC, $order->order_amount, $order->sn, '用户充值' ); } } // 更新充值订单状态 $order->transaction_id = $extra['transaction_id']; $order->pay_status = PayEnum::ISPAID; $order->pay_time = time(); $order->save(); } }