SaasIntegralCat.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 "{{%saas_integral_cat}}".
  13. *
  14. * @property integer $id
  15. * @property string $name
  16. * @property integer $is_enable
  17. * @property integer $is_delete
  18. * @property integer $created_at
  19. * @property integer $updated_at
  20. */
  21. class SaasIntegralCat extends \yii\db\ActiveRecord
  22. {
  23. /**
  24. * 删除状态:已删除
  25. */
  26. const DELETE_STATUS_TRUE = 1;
  27. /**
  28. * 删除状态:未删除
  29. */
  30. const DELETE_STATUS_FALSE = 0;
  31. /**
  32. * 禁用状态:已禁用
  33. */
  34. const IS_ENABLE_FALSE = 0;
  35. /**
  36. * 禁用状态:未禁用
  37. */
  38. const IS_ENABLE_TRUE= 1;
  39. /**
  40. * @inheritdoc
  41. */
  42. public static function tableName()
  43. {
  44. return '{{%saas_integral_cat}}';
  45. }
  46. /**
  47. * @inheritdoc
  48. */
  49. public function rules()
  50. {
  51. return [
  52. [['is_delete', 'is_enable', 'store_id'], 'integer'],
  53. [['name'], 'string', 'max' => 255],
  54. ];
  55. }
  56. public function behaviors()
  57. {
  58. return [
  59. [
  60. 'class' => TimestampBehavior::class,
  61. 'attributes' => [
  62. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
  63. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  64. ]
  65. ]
  66. ];
  67. }
  68. /**
  69. * @inheritdoc
  70. */
  71. public function attributeLabels()
  72. {
  73. return [
  74. 'id' => '分类ID',
  75. 'store_id' => '商城id',
  76. 'name' => '分类名称',
  77. 'is_delete' => 'Is Delete',
  78. 'is_enable' => '状态',
  79. 'created_at' => '创建时间',
  80. 'updated_at' => '更新时间',
  81. ];
  82. }
  83. }