SaasOrderAddress.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 mixed $order_sn
  8. * @property mixed $openid
  9. * @property string $city_text
  10. * @property mixed $city_code
  11. * @property string $nickname
  12. * @property string $mobile
  13. * @property string $address
  14. * @property mixed $create_at
  15. */
  16. class SaasOrderAddress extends Model
  17. {
  18. /**
  19. * The connection name for the model.
  20. *
  21. * @var string|null
  22. */
  23. protected $connection = 'mysql';
  24. /**
  25. * The table associated with the model.
  26. *
  27. * @var string
  28. */
  29. protected string $table = "saas_order_address";
  30. /**
  31. * The primary key associated with the table.
  32. *
  33. * @var string
  34. */
  35. protected string $primaryKey = "id";
  36. /**
  37. * Indicates if the model should be timestamped.
  38. *
  39. * @var bool
  40. */
  41. public bool $timestamps = false;
  42. public function goods(): HasOne
  43. {
  44. return $this->hasOne(SaasGoodsOff::class,"id","goods");
  45. }
  46. public function orders(): HasOne
  47. {
  48. return $this->hasOne(SaasOrder::class,"out_order_no","order_sn");
  49. }
  50. }