Cate.php 1.7 KB

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