Monitor.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\plugins\adopt\models;
  8. use yii\behaviors\TimestampBehavior;
  9. use yii\db\ActiveRecord;
  10. class Monitor extends ActiveRecord
  11. {
  12. public function behaviors()
  13. {
  14. return [
  15. [
  16. // 自动更新创建和更新时间
  17. 'class' => TimestampBehavior::class,
  18. 'value' => time()
  19. ]
  20. ];
  21. }
  22. /**
  23. * @inheritdoc
  24. */
  25. public static function tableName()
  26. {
  27. return '{{%monitor}}';
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function rules()
  33. {
  34. return [
  35. [['store_id', 'status','created_at','updated_at'], 'integer'],
  36. [['store_id','name','serial'], 'required'],
  37. [['name','serial','code','cover_pic'], 'string'],
  38. ];
  39. }
  40. /**
  41. * @inheritdoc
  42. */
  43. public function attributeLabels()
  44. {
  45. return [
  46. 'id' => 'ID',
  47. 'store_id' => 'Store ID',
  48. 'name' => '设备名称',
  49. 'serial' => '序列号',
  50. 'code' => '验证码',
  51. 'status' => '在线状态',
  52. 'created_at' => '首次绑定时间',
  53. 'cover_pic' => '封面图片',
  54. 'updated_at' => '更新时间'
  55. ];
  56. }
  57. }