TableNumber.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. namespace App\Models;
  3. use DateTimeInterface;
  4. use Illuminate\Database\Eloquent\Factories\HasFactory;
  5. use Illuminate\Database\Eloquent\Model;
  6. /**
  7. * App\Models\TableNumber
  8. *
  9. * @property int $id
  10. * @property int $shop_id 店铺ID
  11. * @property int $number 桌号
  12. * @property string $table_code 桌号码
  13. * @property int|null $status 状态
  14. * @property \Illuminate\Support\Carbon|null $created_at
  15. * @property \Illuminate\Support\Carbon|null $updated_at
  16. * @property string|null $title 标题
  17. * @property int|null $is_del
  18. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber newModelQuery()
  19. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber newQuery()
  20. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber query()
  21. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereCreatedAt($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereId($value)
  23. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereIsDel($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereNumber($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereShopId($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereStatus($value)
  27. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereTableCode($value)
  28. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereTitle($value)
  29. * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereUpdatedAt($value)
  30. * @mixin \Eloquent
  31. */
  32. class TableNumber extends Model
  33. {
  34. /**
  35. * The table associated with the model.
  36. *
  37. * @var string
  38. */
  39. protected $table = 'table_number';
  40. /**
  41. * The primary key associated with the table.
  42. *
  43. * @var string
  44. */
  45. protected $primaryKey = 'id';
  46. /**
  47. * Indicates if the model should be timestamped.
  48. *
  49. * @var bool
  50. */
  51. public $timestamps = true;
  52. /**
  53. * 不能被批量赋值的属性
  54. *
  55. * @var array
  56. */
  57. protected $guarded = [ 'id', 'updated_at', 'created_at'];
  58. /**
  59. * 为数组 / JSON 序列化准备日期。
  60. *
  61. * @param DateTimeInterface $date
  62. * @return string
  63. */
  64. protected function serializeDate(DateTimeInterface $date)
  65. {
  66. return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
  67. }
  68. }