Printer.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use Yii;
  9. use yii\behaviors\TimestampBehavior;
  10. use yii\db\ActiveRecord;
  11. /**
  12. * This is the model class for table "{{%printer}}".
  13. *
  14. * @property integer $id
  15. * @property integer $store_id
  16. * @property integer $supplier_id
  17. * @property integer $mch_id
  18. * @property string $name
  19. * @property string $printer_type
  20. * @property string $printer_setting
  21. * @property integer $is_delete
  22. * @property integer $created_at
  23. * @property integer $updated_at
  24. * @property integer $md_id
  25. * @property integer $type
  26. */
  27. class Printer extends \yii\db\ActiveRecord
  28. {
  29. /**
  30. * @inheritdoc
  31. */
  32. public static function tableName()
  33. {
  34. return '{{%printer}}';
  35. }
  36. /**
  37. * @inheritdoc
  38. */
  39. public function rules()
  40. {
  41. return [
  42. [['store_id', 'mch_id', 'is_delete', 'created_at', 'updated_at', 'md_id', 'supplier_id', 'type'], 'integer'],
  43. [['printer_setting'], 'string'],
  44. [['name', 'printer_type'], 'string', 'max' => 255],
  45. ['mch_id', 'default', 'value' => 0]
  46. ];
  47. }
  48. public function behaviors()
  49. {
  50. return [
  51. [
  52. 'class' => TimestampBehavior::class,
  53. 'attributes' => [
  54. ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
  55. ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']
  56. ]
  57. ]
  58. ];
  59. }
  60. /**
  61. * @inheritdoc
  62. */
  63. public function attributeLabels()
  64. {
  65. return [
  66. 'id' => 'ID',
  67. 'store_id' => 'Store ID',
  68. 'mch_id' => '商户主键',
  69. 'name' => '打印机名称',
  70. 'printer_type' => '打印机类型',
  71. 'printer_setting' => '打印机设置',
  72. 'is_delete' => 'Is Delete',
  73. 'updated_at' => '更新时间',
  74. 'created_at' => '创建时间',
  75. 'md_id' => "门店id",
  76. 'supplier_id' => '供货商id',
  77. 'type' => '类型'
  78. ];
  79. }
  80. }