repository = $repository; } /** * 入账回调处理 * @return mixed * @author php迷途小书童 * @created 2021/3/4 15:02 */ public function notify(){ try { $post = $this->request->post(); Log::info(json_encode($post)); $OrderGzcRepository = app()->make(OrderGzcRepository::class); $order = $OrderGzcRepository->getWhere(['gzc_deposit_no' => $post['depositDetailNo']]); if (!$order) return app('json')->fail('error', '订单不存在'); if ($order->success == 1) return app('json')->fail('error', '入账已确认'); //修改订单状态 Db::transaction(function () use ($order, $post) { if ($post['isSuccess'] == '2000') { $order->success = 1; } $order->gzc_confirm_result = json_encode($post); return $order->save(); }); return app('json')->success(['result' => 'SUCCESS']); } catch (\Throwable $e) { Log::info($e->getMessage()); return app('json')->fail('error', $e->getMessage()); } } }