|
|
@ -2252,22 +2252,30 @@ class OrderService extends AdminBaseService |
|
|
|
|
|
|
|
|
if (in_array($order['status'], [7, 8])) return $this->toData('1', '订单已退款,不可操作'); |
|
|
if (in_array($order['status'], [7, 8])) return $this->toData('1', '订单已退款,不可操作'); |
|
|
|
|
|
|
|
|
if ($param['get_num'] > $order['num']) { |
|
|
// if ($param['get_num'] > $order['num']) { |
|
|
return $this->toData('1', '修改中签数不能大于订单申购数'); |
|
|
// return $this->toData('1', '修改中签数不能大于订单申购数'); |
|
|
} |
|
|
// } |
|
|
|
|
|
// 1 2 5 状态才能修改数量 |
|
|
$getTime = Db::table($tableObj['stock_table'])->where('id', $order['pre_stock_id'])->value('get_time'); |
|
|
if (!in_array($order['status'], [1, 2, 5])) { |
|
|
if (env('USER_ARREARS.HAS_USER_ARREARS') == 1 && $order['pay_type'] == 2 && in_array($order['status'], [5, 6])) { |
|
|
return $this->toData('1', 'IPO已上市,无法修改'); |
|
|
} else { |
|
|
} |
|
|
if (strtotime($getTime) < time()) return $this->toData('1', 'IPO已中签,无法修改'); |
|
|
// $getTime = Db::table($tableObj['stock_table'])->where('id', $order['pre_stock_id'])->value('get_time'); |
|
|
} |
|
|
// if (env('USER_ARREARS.HAS_USER_ARREARS') == 1 && $order['pay_type'] == 2 && in_array($order['status'], [5, 6])) { |
|
|
|
|
|
// } else { |
|
|
$bool = Db::table($tableObj['order_table'])->where('id', $param['id'])->update([ |
|
|
// if (strtotime($getTime) < time()) return $this->toData('1', 'IPO已中签,无法修改'); |
|
|
|
|
|
// } |
|
|
|
|
|
$updateArr = [ |
|
|
'get_num' => $param['get_num'], |
|
|
'get_num' => $param['get_num'], |
|
|
'get_amount' => $param['get_num'] * $order['price'], |
|
|
'get_amount' => $param['get_num'] * $order['price'], |
|
|
'get_fee' => $order['get_amount'] * $order['fee_rate'], |
|
|
'get_fee' => $order['get_amount'] * $order['fee_rate'], |
|
|
'update_time' => date('Y-m-d H:i:s') |
|
|
'update_time' => date('Y-m-d H:i:s') |
|
|
]); |
|
|
]; |
|
|
|
|
|
if ($order['pay_type'] == 2) { |
|
|
|
|
|
$updateArr['num'] = $param['get_num']; |
|
|
|
|
|
$updateArr['amount'] = $param['get_num'] * $order['price']; |
|
|
|
|
|
$updateArr['fee'] = $updateArr['amount'] * $order['fee_rate']; |
|
|
|
|
|
} |
|
|
|
|
|
$bool = Db::table($tableObj['order_table'])->where('id', $param['id'])->update($updateArr); |
|
|
if (!$bool) return $this->toData('1', '修改失败'); |
|
|
if (!$bool) return $this->toData('1', '修改失败'); |
|
|
|
|
|
|
|
|
return $this->toData('0', 'SUCCESS', []); |
|
|
return $this->toData('0', 'SUCCESS', []); |
|
|
|