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