BlueArticle.php 883 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\model\blue;
  3. use app\extra\basic\Model;
  4. use think\model\relation\HasOne;
  5. /**
  6. * @property integer $id (主键)
  7. */
  8. class BlueArticle extends Model
  9. {
  10. /**
  11. * The connection name for the model.
  12. *
  13. * @var string|null
  14. */
  15. protected $connection = 'mysql';
  16. /**
  17. * The table associated with the model.
  18. *
  19. * @var string
  20. */
  21. protected string $table = "blue_article";
  22. /**
  23. * The primary key associated with the table.
  24. *
  25. * @var string
  26. */
  27. protected string $primaryKey = "id";
  28. /**
  29. * Indicates if the model should be timestamped.
  30. *
  31. * @var bool
  32. */
  33. public bool $timestamps = false;
  34. public function categoryJoin(): HasOne
  35. {
  36. return $this->hasOne(BlueCategory::class,"id","category");
  37. }
  38. }