This commit is contained in:
邓皓元 2019-04-18 09:36:04 +08:00
parent 0df7e107ec
commit 15436bddd0

View File

@ -709,13 +709,13 @@ class OrderService extends Service
if ($counts) { if ($counts) {
throw new NotAllowedException('订单中的卡已存在于其他类型订单中,不能进行重置'); throw new NotAllowedException('订单中的卡已存在于其他类型订单中,不能进行重置');
} }
} else {
// 转销售重置 // 替卡重置
$sql = 'UPDATE virtual_order_cards_partition SET sim=original_sim,original_sim=0 $sql = 'UPDATE virtual_order_cards_partition SET sim=original_sim,original_sim=0
WHERE original_sim IN ( WHERE sim IN (
SELECT DISTINCT SIM FROM virtual_order_cards_partition WHERE type=0 AND order_id = ? SELECT DISTINCT SIM FROM virtual_order_cards_partition WHERE type = ? AND order_id = ?
)'; )';
DB::statement($sql, [$id]); DB::statement($sql, [$node->type, $id]);
$node->order_status = 0; $node->order_status = 0;
$node->save(); $node->save();