Cate.php 1.9 KB

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