MchDiyPage.php 1.6 KB

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