FoodTableNumber.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\plugins\food\models;
  8. use yii\behaviors\TimestampBehavior;
  9. use yii\db\ActiveRecord;
  10. /**
  11. * This is the model class for table "{{%food_table_number}}".
  12. *
  13. * @property integer $id
  14. * @property string $num
  15. * @property string $remark
  16. * @property string $md_id
  17. * @property integer $store_id
  18. * @property integer $is_delete
  19. * @property integer $created_at
  20. * @property integer $updated_at
  21. */
  22. class FoodTableNumber extends ActiveRecord
  23. {
  24. /**
  25. * 删除状态:已删除
  26. */
  27. const DELETE_STATUS_TRUE = 1;
  28. /**
  29. * 删除状态:未删除
  30. */
  31. const DELETE_STATUS_FALSE = 0;
  32. /**
  33. * @inheritdoc
  34. */
  35. public static function tableName()
  36. {
  37. return '{{%food_table_number}}';
  38. }
  39. /**
  40. * @inheritdoc
  41. */
  42. public function rules()
  43. {
  44. return [
  45. [['store_id', 'is_delete', 'md_id'], 'integer'],
  46. [['num', 'remark'], 'string', 'max' => 255],
  47. ];
  48. }
  49. public function behaviors()
  50. {
  51. return [
  52. [
  53. 'class' => TimestampBehavior::class,
  54. 'attributes' => [
  55. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
  56. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  57. ]
  58. ]
  59. ];
  60. }
  61. /**
  62. * @inheritdoc
  63. */
  64. public function attributeLabels()
  65. {
  66. return [
  67. 'id' => 'ID',
  68. 'num' => '桌号',
  69. 'store_id' => 'store id',
  70. 'is_delete' => '是否删除',
  71. 'created_at' => '创建时间',
  72. 'updated_at' => '更新时间',
  73. 'remark' => '备注',
  74. ];
  75. }
  76. }