Cate.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace addons\RfDemo\common\models;
  3. use common\traits\Tree;
  4. use common\behaviors\MerchantBehavior;
  5. /**
  6. * This is the model class for table "{{%addon_demo_cate}}".
  7. *
  8. * @property int $id 主键
  9. * @property int|null $merchant_id 商户id
  10. * @property string $title 标题
  11. * @property int|null $sort 排序
  12. * @property int|null $level 级别
  13. * @property int|null $pid 上级id
  14. * @property string $tree 树
  15. * @property int|null $status 状态
  16. * @property int $created_at 创建时间
  17. * @property int $updated_at 更新时间
  18. */
  19. class Cate extends \common\models\base\BaseModel
  20. {
  21. use Tree, MerchantBehavior;
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public static function tableName()
  26. {
  27. return '{{%addon_demo_cate}}';
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function rules()
  33. {
  34. return [
  35. [['title'], 'required'],
  36. [['merchant_id', 'sort', 'level', 'pid', 'status', 'created_at', 'updated_at'], 'integer'],
  37. [['title'], 'string', 'max' => 50],
  38. [['tree'], 'string', 'max' => 500],
  39. ];
  40. }
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function attributeLabels()
  45. {
  46. return [
  47. 'id' => '主键',
  48. 'merchant_id' => '商户id',
  49. 'title' => '标题',
  50. 'sort' => '排序',
  51. 'level' => '级别',
  52. 'pid' => '上级',
  53. 'tree' => '树',
  54. 'status' => '状态',
  55. 'created_at' => '创建时间',
  56. 'updated_at' => '更新时间',
  57. ];
  58. }
  59. }
粤ICP备19079148号