Commit 6035d2b485121c765ff947c82443a34066373a5f
1 parent
41f0c492
Order body length
Showing
1 changed file
with
9 additions
and
7 deletions
Show diff stats
models/Order.php
| @@ -141,7 +141,10 @@ | @@ -141,7 +141,10 @@ | ||
| 141 | 'required', | 141 | 'required', |
| 142 | ], | 142 | ], |
| 143 | [ | 143 | [ |
| 144 | - [ 'comment' ], | 144 | + [ |
| 145 | + 'comment', | ||
| 146 | + 'body', | ||
| 147 | + ], | ||
| 145 | 'string', | 148 | 'string', |
| 146 | ], | 149 | ], |
| 147 | [ | 150 | [ |
| @@ -161,7 +164,6 @@ | @@ -161,7 +164,6 @@ | ||
| 161 | 'deadline', | 164 | 'deadline', |
| 162 | 'name', | 165 | 'name', |
| 163 | 'numbercard', | 166 | 'numbercard', |
| 164 | - 'body', | ||
| 165 | 'declaration', | 167 | 'declaration', |
| 166 | 'stock', | 168 | 'stock', |
| 167 | 'consignment', | 169 | 'consignment', |
| @@ -183,7 +185,7 @@ | @@ -183,7 +185,7 @@ | ||
| 183 | public function afterFind() | 185 | public function afterFind() |
| 184 | { | 186 | { |
| 185 | parent::afterFind(); | 187 | parent::afterFind(); |
| 186 | - $this->deadline = !empty($this->deadline) ? date('d.m.Y', $this->deadline) : ''; | 188 | + $this->deadline = !empty( $this->deadline ) ? date('d.m.Y', $this->deadline) : ''; |
| 187 | 189 | ||
| 188 | } | 190 | } |
| 189 | 191 | ||
| @@ -200,7 +202,7 @@ | @@ -200,7 +202,7 @@ | ||
| 200 | 202 | ||
| 201 | protected function convertDate() | 203 | protected function convertDate() |
| 202 | { | 204 | { |
| 203 | - if (!empty($this->deadline)) { | 205 | + if (!empty( $this->deadline )) { |
| 204 | $date = new \DateTime(); | 206 | $date = new \DateTime(); |
| 205 | $date->setTimestamp(strtotime($this->deadline)); | 207 | $date->setTimestamp(strtotime($this->deadline)); |
| 206 | $date->format("d.m.Y"); | 208 | $date->format("d.m.Y"); |
| @@ -289,8 +291,8 @@ | @@ -289,8 +291,8 @@ | ||
| 289 | */ | 291 | */ |
| 290 | public function getDeliveryString() | 292 | public function getDeliveryString() |
| 291 | { | 293 | { |
| 292 | - if (!empty($this->orderDelivery)) { | ||
| 293 | - if (!empty($this->orderDelivery->parent)) { | 294 | + if (!empty( $this->orderDelivery )) { |
| 295 | + if (!empty( $this->orderDelivery->parent )) { | ||
| 294 | return $this->orderDelivery->parent->lang->title . ': ' . $this->orderDelivery->lang->title; | 296 | return $this->orderDelivery->parent->lang->title . ': ' . $this->orderDelivery->lang->title; |
| 295 | } else { | 297 | } else { |
| 296 | return $this->orderDelivery->lang->title; | 298 | return $this->orderDelivery->lang->title; |
| @@ -308,7 +310,7 @@ | @@ -308,7 +310,7 @@ | ||
| 308 | */ | 310 | */ |
| 309 | public function getWasted() | 311 | public function getWasted() |
| 310 | { | 312 | { |
| 311 | - if (empty($this->deadline)) { | 313 | + if (empty( $this->deadline )) { |
| 312 | return false; | 314 | return false; |
| 313 | } else { | 315 | } else { |
| 314 | return time() > strtotime($this->deadline); | 316 | return time() > strtotime($this->deadline); |