'='], ['user:id,username']) ->where('is_withdraw', true) ->orderByDesc('id'); return $this->paginate($query); } // 拒绝 public function reject($id): JsonResponse { $log = CommissionLog::query() ->where('is_withdraw', true) ->where('status', WithdrawStatus::PENDING) ->findOrFail($id); $log->status = WithdrawStatus::REJECTED; $log->save(); $log->user->commission = bcadd($log->user->commission, abs($log->amount), 4); $log->user->save(); return $this->success(); } // 确认打款 public function confirm($id): JsonResponse { $log = CommissionLog::query() ->where('is_withdraw', true) ->where('status', WithdrawStatus::PENDING) ->findOrFail($id); $log->status = WithdrawStatus::PAID; $log->save(); return $this->success(); } }