private function savePayLog($orderId, $payType, $payNum, $payState) { $payLog = new UserOrderPayLog(); $payLog->order_id = $orderId; $payLog->order_pay_type = $payType; $payLog->order_pay_number = $payNum; $payLog->order_pay_state = $payState; $payLog->order_pay_log_info = ''; $payLog->save(); }
/** * 支付日志 * @param int $orderLongId 长订单号 * @param string $payNumber 支付网关订单号 * @param int $payType 支付类型 * @param int $payState 状态 * @param string|array $logInfo */ protected function savePayLog($orderLongId, $payNumber, $payType, $payState, $logInfo) { $log = new UserOrderPayLog(); $log->order_id = $orderLongId; $log->order_pay_type = $payType; $log->order_pay_number = $payNumber; $log->order_pay_state = $payState; $log->order_pay_log_info = is_string($logInfo) ? $logInfo : json_encode($logInfo); if ($log->save() == false) { $this->databaseErrorLog($log); } }