transaction
This commit is contained in:
parent
c755199298
commit
027f5ef85e
@ -695,11 +695,18 @@ class OrderService extends Service
|
||||
};
|
||||
|
||||
$table = $this->tables[$order['type']];
|
||||
DB::table($table)->upsert($orderCards, ['sim', 'order_id', 'refunded_at', 'deleted_at']);
|
||||
$fixSimArray = implode(',', $simArray);
|
||||
DB::statement("select fix_timelines('{{$fixSimArray}}'::INT8[]);");
|
||||
|
||||
DB::transaction(function() use($table, $orderCards, $simArray) {
|
||||
foreach ($orderCards as $value) {
|
||||
DB::table($table)->upsert($value, ['sim', 'order_id', 'refunded_at', 'deleted_at']);
|
||||
$fixSimArray = implode(',', $simArray);
|
||||
DB::statement("select fix_timelines('{{$fixSimArray}}'::INT8[]);");
|
||||
}
|
||||
});
|
||||
|
||||
app(OrderCardPartitionRepository::class)->forgetCached();
|
||||
|
||||
|
||||
return $order;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user