SaasStoreFactory.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 integer $agent_id 所属代理
  8. * @property integer $store_id
  9. * @property integer $factory_id
  10. * @property integer $day_order 日订单量
  11. * @property mixed $create_at
  12. */
  13. class SaasStoreFactory extends Model
  14. {
  15. /**
  16. * The connection name for the model.
  17. *
  18. * @var string|null
  19. */
  20. protected $connection = 'mysql';
  21. /**
  22. * The table associated with the model.
  23. *
  24. * @var string
  25. */
  26. protected string $table = "saas_store_factory";
  27. /**
  28. * The primary key associated with the table.
  29. *
  30. * @var string
  31. */
  32. protected string $primaryKey = "id";
  33. /**
  34. * Indicates if the model should be timestamped.
  35. *
  36. * @var bool
  37. */
  38. public bool $timestamps = false;
  39. public function factory(): HasOne
  40. {
  41. return $this->hasOne("app\model\saas\SaasFactory","factory_id","factory_id");
  42. }
  43. public function store(): HasOne
  44. {
  45. return $this->hasOne("app\model\saas\SaasStore","store_id","store_id");
  46. }
  47. public function agent(): HasOne
  48. {
  49. return $this->hasOne("app\model\saas\SaasAgent","agent_id","agent_id");
  50. }
  51. }