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()); } } /** * 从第几行开始处理数据 就是不处理标题 * * @return int */ public function startRow(): int { return 2; } /** * Notes: 批量导入1000条 * * @Author: 玄尘 * @Date : 2020/11/23 13:40 * @return int */ public function chunkSize(): int { return $this->chunk; } /** * Notes: 以1000条数据基准切割数据 * * @Author: 玄尘 * @Date : 2020/11/23 13:41 * @return int */ public function batchSize(): int { return $this->chunk; } }