DeliveryNote.php 1001 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Model;
  3. use Illuminate\Database\Eloquent\Model;
  4. /**
  5. * 交车单
  6. * Class Unit
  7. * @package App\Models
  8. */
  9. class DeliveryNote extends Model
  10. {
  11. protected $table = "delivery_note"; //指定表
  12. const CREATED_AT = 'crt_time';
  13. const UPDATED_AT = 'upd_time';
  14. protected $dateFormat = 'U';
  15. public function setBreakAttribute($value)
  16. {
  17. $this->attributes['break'] = json_encode($value);
  18. }
  19. public function getBreakAttribute($value)
  20. {
  21. return json_decode($value, true);
  22. }
  23. public function setBreakMarkAttribute($value)
  24. {
  25. $this->attributes['break_mark'] = json_encode($value);
  26. }
  27. public function getBreakMarkAttribute($value)
  28. {
  29. return json_decode($value, true);
  30. }
  31. public function setProjectIdAttribute($value)
  32. {
  33. $this->attributes['project_id'] = json_encode($value);
  34. }
  35. public function getProjectIdAttribute($value)
  36. {
  37. return json_decode($value, true);
  38. }
  39. }