virtual_order_cards
This commit is contained in:
parent
2808862b96
commit
e135e6624e
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Domains\Virtual\Services;
|
namespace App\Domains\Virtual\Services;
|
||||||
|
|
||||||
|
use Log;
|
||||||
use App\Dicts;
|
use App\Dicts;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use App\Core\Service;
|
use App\Core\Service;
|
||||||
@ -955,7 +956,7 @@ class OrderService extends Service
|
|||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
Log::error('操作失败 #:' . $e->getMessage());
|
Log::error('操作失败 #:' . $e->getMessage());
|
||||||
throw new HttpException('操作失败');
|
throw new HttpException('操作失败' . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
@ -1009,7 +1010,9 @@ class OrderService extends Service
|
|||||||
|
|
||||||
foreach (array_chunk($data, 1000) as $value) {
|
foreach (array_chunk($data, 1000) as $value) {
|
||||||
if ($table === 'virtual_order_cards') {
|
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)) {
|
if (!empty($exists)) {
|
||||||
throw new ExistedException('出现重复销售卡 #:' . implode(',', $exists));
|
throw new ExistedException('出现重复销售卡 #:' . implode(',', $exists));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user