diff --git a/app/Domains/Virtual/Services/OrderService.php b/app/Domains/Virtual/Services/OrderService.php index 7dc03dd9..a5b78fcf 100644 --- a/app/Domains/Virtual/Services/OrderService.php +++ b/app/Domains/Virtual/Services/OrderService.php @@ -2,6 +2,7 @@ namespace App\Domains\Virtual\Services; +use Log; use App\Dicts; use Carbon\Carbon; use App\Core\Service; @@ -955,7 +956,7 @@ class OrderService extends Service } catch (\Exception $e) { DB::rollBack(); Log::error('操作失败 #:' . $e->getMessage()); - throw new HttpException('操作失败'); + throw new HttpException('操作失败' . $e->getMessage()); } DB::commit(); @@ -1009,7 +1010,9 @@ class OrderService extends Service foreach (array_chunk($data, 1000) as $value) { if ($table === 'virtual_order_cards') { - $exists = DB::table($table)->whereIn('sim', array_pluck($value, 'sim'))->whereNull('deleted_at')->get()->pluck('sim')->toArray(); + $exists = DB::table($table)->whereIn('sim', array_pluck($value, 'sim')) + ->whereNull('refunded_at') + ->whereNull('deleted_at')->get()->pluck('sim')->toArray(); if (!empty($exists)) { throw new ExistedException('出现重复销售卡 #:' . implode(',', $exists)); }