virtual_order_cards

This commit is contained in:
邓皓元 2019-08-16 17:38:58 +08:00
parent 2808862b96
commit e135e6624e

View File

@ -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));
}