conditions = $conditions; parent::__construct(); } public function query() { $builder = app(OrderCardPartitionRepository::class)->forceNoReset()->select(['sim', 'counts', 'refunded_at']) ->withConditions($this->conditions)->orderBy('sim'); return $builder; } public function headings(): array { return [ 'SIM', '数量', '退货', ]; } /** * @param mixed $row * * @return mixed */ public function rows($rows) { $array = []; foreach ($rows as $item) { $array[] = [ $item['sim'], $item['counts'], $item['refunded_at'] ? '是' : '', ]; } return $array; } /** * @return array */ public function columnFormats(): array { return [ 'A' => NumberFormat::FORMAT_NUMBER, 'B' => NumberFormat::FORMAT_NUMBER, ]; } }