DeliveryNote.php 805 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. const STATE_ZERO = 0;
  16. const STATE_ONE = 1;
  17. public static $name = [
  18. self::STATE_ZERO => '已保存',
  19. self::STATE_ONE => '已交车',
  20. ];
  21. public function getBreakAttribute($value)
  22. {
  23. return json_decode($value, true);
  24. }
  25. public function getBreakMarkAttribute($value)
  26. {
  27. return json_decode($value, true);
  28. }
  29. public function getProjectIdAttribute($value)
  30. {
  31. return json_decode($value, true);
  32. }
  33. }