SaasPrint.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace app\model\saas;
  3. use app\extra\basic\Model;
  4. use think\model\relation\HasOne;
  5. /**
  6. * @property integer $id (主键)
  7. * @property string $sn 序列号
  8. * @property integer $agent_id
  9. * @property integer $store_id
  10. * @property string $device_key
  11. * @property string $name 打印机名称
  12. * @property mixed $create_at
  13. */
  14. class SaasPrint 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 = "saas_print";
  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 agent(): HasOne
  41. {
  42. return $this->hasOne("app\model\saas\SaasAgent","agent_id","agent_id");
  43. }
  44. public function store(): HasOne
  45. {
  46. return $this->hasOne("app\model\saas\SaasStore","store_id","store_id");
  47. }
  48. }