SaasOrder.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 mixed $product_id
  10. * @property mixed $sku_id
  11. * @property integer $number
  12. * @property string $img
  13. * @property integer $price
  14. * @property integer $line_price
  15. * @property string $sku_name
  16. * @property mixed $poi_id
  17. * @property mixed $mobile
  18. */
  19. class SaasOrder extends Model
  20. {
  21. /**
  22. * The connection name for the model.
  23. *
  24. * @var string|null
  25. */
  26. protected $connection = 'mysql';
  27. /**
  28. * The table associated with the model.
  29. *
  30. * @var string
  31. */
  32. protected string $table = "saas_order";
  33. /**
  34. * The primary key associated with the table.
  35. *
  36. * @var string
  37. */
  38. protected string $primaryKey = "id";
  39. /**
  40. * Indicates if the model should be timestamped.
  41. *
  42. * @var bool
  43. */
  44. public bool $timestamps = false;
  45. public function product(): HasOne
  46. {
  47. return $this->hasOne(SaasGoods::class,"product_id","product_id");
  48. }
  49. public function poi(): HasOne
  50. {
  51. return $this->hasOne(SaasStore::class,"poi_id","poi_id");
  52. }
  53. public function user(): HasOne
  54. {
  55. return $this->hasOne(SaasUserOpen::class,"openid","openid");
  56. }
  57. }