tiaobug
This commit is contained in:
@@ -29,15 +29,19 @@ class SettleCouponImport implements ToModel, WithStartRow, WithChunkReading, Wit
|
||||
try {
|
||||
$order_id = trim($row[0]);
|
||||
$exists = Coupon::query()->where('pa_order_id', $order_id)->exists();
|
||||
if ($exists) {
|
||||
Coupon::query()->where('pa_order_id', $order_id)->update([
|
||||
'is_settle' => 1
|
||||
]);
|
||||
} else {
|
||||
$exists = CouponPaCheck::query()->where('pa_order_id', $order_id)->exists();
|
||||
if (! $exists) {
|
||||
CouponPaCheck::create([
|
||||
'pa_order_id' => $order_id
|
||||
]);
|
||||
} else {
|
||||
Coupon::query()->where('pa_order_id', $order_id)->update([
|
||||
'is_settle' => 1
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
throw new \Exception($e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user