DiyPage.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. /**
  10. * This is the model class for table "{{%diy_page}}".
  11. *
  12. * @property integer $id
  13. * @property integer $store_id
  14. * @property string $title
  15. * @property integer $template_id
  16. * @property integer $is_delete
  17. * @property integer $addtime
  18. * @property integer $status
  19. * @property integer $is_index
  20. */
  21. class DiyPage extends \yii\db\ActiveRecord
  22. {
  23. /**
  24. * @inheritdoc
  25. */
  26. public static function tableName()
  27. {
  28. return '{{%diy_page}}';
  29. }
  30. /**
  31. * @inheritdoc
  32. */
  33. public function rules()
  34. {
  35. return [
  36. [['store_id', 'template_id', 'is_delete', 'addtime', 'status', 'is_index'], 'integer'],
  37. [['template_id', 'addtime'], 'required'],
  38. [['title'], 'string', 'max' => 45],
  39. ];
  40. }
  41. /**
  42. * @inheritdoc
  43. */
  44. public function attributeLabels()
  45. {
  46. return [
  47. 'id' => 'ID',
  48. 'store_id' => 'Store ID',
  49. 'title' => '页面标题',
  50. 'template_id' => '模板ID',
  51. 'is_delete' => 'Is Delete',
  52. 'addtime' => 'Addtime',
  53. 'status' => '状态 0--禁用 1--启用',
  54. 'is_index' => '是否覆盖首页 0--不覆盖 1--覆盖',
  55. ];
  56. }
  57. public function getTemplate()
  58. {
  59. return $this->hasOne(DiyTemplate::className(), ['id' => 'template_id']);
  60. }
  61. }