BlueCategory.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace app\model\blue;
  3. use app\extra\basic\Model;
  4. use think\model\relation\HasMany;
  5. /**
  6. * @property integer $id (主键)
  7. * @property string $name 名称
  8. * @property string $icon 普通图标
  9. * @property string $small_icon 小图标
  10. * @property integer $sort 排序
  11. * @property integer $type 1任务2文章
  12. * @property mixed $create_at 创建时间
  13. */
  14. class BlueCategory extends Model
  15. {
  16. /**
  17. * The connection name for the model.
  18. *
  19. * @var string|null
  20. */
  21. protected $connection = 'mysql';
  22. /**
  23. * The table associated with the model.
  24. *
  25. * @var string
  26. */
  27. protected string $table = "blue_category";
  28. /**
  29. * The primary key associated with the table.
  30. *
  31. * @var string
  32. */
  33. protected string $primaryKey = "id";
  34. /**
  35. * Indicates if the model should be timestamped.
  36. *
  37. * @var bool
  38. */
  39. public bool $timestamps = false;
  40. public function article(): HasMany
  41. {
  42. return $this->hasMany(BlueArticle::class,"category","id");
  43. }
  44. }