| @@ 125-136 (lines=12) @@ | ||
| 122 | * @param string $sql |
|
| 123 | * @return void |
|
| 124 | */ |
|
| 125 | protected function doUpdateStatement($sql) |
|
| 126 | { |
|
| 127 | $now = \Carbon\Carbon::now()->toDateTimeString(); |
|
| 128 | ||
| 129 | DB::statement($sql, [ |
|
| 130 | 'date' => $this->argument('date'), |
|
| 131 | 'connection' => $this->argument('connection'), |
|
| 132 | 'hits' => $this->argument('hits'), |
|
| 133 | 'misses' => $this->argument('misses'), |
|
| 134 | 'updated_at' => $now |
|
| 135 | ]); |
|
| 136 | } |
|
| 137 | ||
| 138 | /** |
|
| 139 | * Helper. avoid duplicate code |
|
| @@ 145-157 (lines=13) @@ | ||
| 142 | * @param string $sql |
|
| 143 | * @return void |
|
| 144 | */ |
|
| 145 | protected function doUpsertStatement($sql) |
|
| 146 | { |
|
| 147 | $now = \Carbon\Carbon::now()->toDateTimeString(); |
|
| 148 | ||
| 149 | DB::statement($sql, [ |
|
| 150 | 'date' => $this->argument('date'), |
|
| 151 | 'connection' => $this->argument('connection'), |
|
| 152 | 'hits' => $this->argument('hits'), |
|
| 153 | 'misses' => $this->argument('misses'), |
|
| 154 | 'created_at' => $now, |
|
| 155 | 'updated_at' => $now |
|
| 156 | ]); |
|
| 157 | } |
|
| 158 | ||
| 159 | /** |
|
| 160 | * Get the status of a sqlite3 UPDATE operation |
|