|
|
@ -3073,6 +3073,22 @@ class OrderService extends AdminBaseService |
|
|
|
} else { |
|
|
|
$stockIdOrContractId = $item['stock_id']; |
|
|
|
} |
|
|
|
// 计算浮动盈亏 |
|
|
|
$float = 0; |
|
|
|
if ($item['status'] == 3) { |
|
|
|
if ($item['trade_type'] == 1) { |
|
|
|
// $float = $item['closing_price'] - $item['deal_price']; |
|
|
|
$float = bcsub($item['closing_price'], $item['deal_price'], 18); |
|
|
|
} else { |
|
|
|
// $float = $item['deal_price'] - $item['closing_price']; |
|
|
|
$float = bcsub($item['deal_price'], $item['closing_price'], 18); |
|
|
|
} |
|
|
|
$float = bcmul($float, $item['order_number'], 18); |
|
|
|
} |
|
|
|
|
|
|
|
$orderNumber = number_format($item['order_number'], '18', '.', ''); |
|
|
|
$orderPrice = number_format($item['deal_price'], '18', '.', ''); |
|
|
|
$orderAmount = bcmul($orderNumber, $orderPrice, 18); |
|
|
|
$rows[] = [ |
|
|
|
'trade_id' => $item['trade_id'], // |
|
|
|
'user_no' => $userNoArr[$item['user_id']] ?? '-', // 用户号 |
|
|
@ -3082,13 +3098,16 @@ class OrderService extends AdminBaseService |
|
|
|
'order_money' => $orderAmount, // 订单金额 |
|
|
|
'stock_id' => $stockIdOrContractId, // 股票代码 |
|
|
|
'order_number' => $item['order_number'], // 数量 |
|
|
|
'service_cost' => $item['service_cost'], // 服务费 |
|
|
|
'float' => '-', // 浮动盈亏 |
|
|
|
'service_cost' => $item['status'] == 3 ? $item['closing_cost'] : $item['service_cost'], // 服务费 |
|
|
|
'deal_price' => $item['deal_price'], // 开仓价 |
|
|
|
'now_price' => '-', // 当前价 |
|
|
|
'stop_loss_price' => $item['stop_loss_price'], // 止损价 |
|
|
|
'stop_win_price' => $item['stop_win_price'], // 止盈价 |
|
|
|
'pry_num' => $item['pry_num'], // 杠杆 |
|
|
|
'closing_time' => $item['closing_time'] ?? '-', // 完成时间 |
|
|
|
'closing_price' => $item['closing_price'] ?? '-', // 平仓价 |
|
|
|
'float' => $float, // 平仓盈亏 |
|
|
|
'digital_id' => $stockIdOrContractId, // 股票代码 |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|