transaction

This commit is contained in:
邓皓元 2019-11-15 13:10:04 +08:00
parent 027f5ef85e
commit 0fe126c938

View File

@ -696,14 +696,15 @@ class OrderService extends Service
$table = $this->tables[$order['type']];
DB::transaction(function() use($table, $orderCards, $simArray) {
DB::transaction(function() use($table, $orderCards) {
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[]);");
}
});
$fixSimArray = implode(',', $simArray);
DB::statement("select fix_timelines('{{$fixSimArray}}'::INT8[]);");
app(OrderCardPartitionRepository::class)->forgetCached();