ShopPrinter.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace App\Models;
  3. use DateTimeInterface;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * 商家打印机表
  7. *
  8. * @property int $id 商家绑定打印机
  9. * @property int|null $shop_id
  10. * @property int|null $brand_id 品牌id
  11. * @property string|null $note 打印机备注
  12. * @property string|null $sn 打印机sn
  13. * @property string|null $key 打印机key
  14. * @property int|null $template 模板类型 1为58mm 2为75mm
  15. * @property int|null $is_del 是否删除 0否1是
  16. * @property \Illuminate\Support\Carbon|null $created_at
  17. * @property \Illuminate\Support\Carbon|null $updated_at
  18. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter newModelQuery()
  19. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter newQuery()
  20. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter query()
  21. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter whereBrandId($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter whereCreatedAt($value)
  23. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter whereId($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter whereIsDel($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter whereKey($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter whereNote($value)
  27. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter whereShopId($value)
  28. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter whereSn($value)
  29. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter whereTemplate($value)
  30. * @method static \Illuminate\Database\Eloquent\Builder|ShopPrinter whereUpdatedAt($value)
  31. * @mixin \Eloquent
  32. */
  33. class ShopPrinter extends Model
  34. {
  35. /**
  36. * The table associated with the model.
  37. *
  38. * @var string
  39. */
  40. protected $table = 'shops_printer';
  41. /**
  42. * The primary key associated with the table.
  43. *
  44. * @var string
  45. */
  46. protected $primaryKey = 'id';
  47. /**
  48. * Indicates if the model should be timestamped.
  49. *
  50. * @var bool
  51. */
  52. public $timestamps = true;
  53. /**
  54. * 不能被批量赋值的属性
  55. *
  56. * @var array
  57. */
  58. protected $guarded = ['id', 'updated_at', 'created_at'];
  59. /**
  60. * 为数组 / JSON 序列化准备日期。
  61. *
  62. * @param DateTimeInterface $date
  63. * @return string
  64. */
  65. protected function serializeDate(DateTimeInterface $date)
  66. {
  67. return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
  68. }
  69. }