rechargeAmount($fx_uid, $amount); if ($flag) { static::addLog($fx_uid, 3, $amount, ''); return Util::returnArrSu(); } else { return Util::returnArrEr('退款失败![amount_1001]'); } } /** * 添加日志 * @param $fx_uid * @param $trade_type int 交易类型 1、充值 2、支出 3、退款 * @param $amount * @param $msg * @return array */ public static function addLog($fx_uid, $trade_type, $amount, $msg) { $fxUserAccount = new FxUserAccount(); $info = $fxUserAccount->getMyCommission($fx_uid); $remaining_sum = $info['remaining_sum']; $fxUserAmountLog = new FxUserAmountLog(); return $fxUserAmountLog->addLog($fx_uid, $trade_type, $amount, $remaining_sum, $msg); } /** * 取消订单加扣款 * @param $params * @return array */ public function cancelOrder($params) { $order = new OrderMain(); $orderInfo = $order->getOrderInfoById($params['order_id']); $fx_uid = $orderInfo['fx_uid']; return self::refund($fx_uid, $params['refund_fee']); } }