SaasOrder.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 $uuid
  8. * @property integer $agent_id 代理id
  9. * @property integer $store_id 店铺id
  10. * @property string $order_id
  11. * @property integer $product_id 商品ID
  12. * @property string $product_name
  13. * @property string $username
  14. * @property string $code
  15. * @property string $mobile
  16. * @property string $region
  17. * @property string $address
  18. * @property integer $status
  19. * @property string $express_id 顺丰订单id
  20. * @property integer $is_send 1已发送
  21. * @property integer $is_auto 1自动呼叫快递
  22. * @property string $remark
  23. * @property mixed $create_at
  24. */
  25. class SaasOrder extends Model
  26. {
  27. /**
  28. * The connection name for the model.
  29. *
  30. * @var string|null
  31. */
  32. protected $connection = 'mysql';
  33. /**
  34. * The table associated with the model.
  35. *
  36. * @var string
  37. */
  38. protected string $table = "saas_order";
  39. /**
  40. * The primary key associated with the table.
  41. *
  42. * @var string
  43. */
  44. protected string $primaryKey = "id";
  45. /**
  46. * Indicates if the model should be timestamped.
  47. *
  48. * @var bool
  49. */
  50. public bool $timestamps = false;
  51. public function goods(): HasOne
  52. {
  53. return $this->hasOne("app\model\saas\SaasGoods",'out_id','product_id');
  54. }
  55. public function poi(): HasOne
  56. {
  57. return $this->hasOne("app\model\saas\SaasStoreShop",'poi_id','poi_id');
  58. }
  59. public function parent(): HasOne
  60. {
  61. return $this->hasOne("app\model\saas\SaasOrderLife",'order_id','order_id');
  62. }
  63. public function store(): HasOne
  64. {
  65. return $this->hasOne("app\model\saas\SaasStore",'store_id','store_id');
  66. }
  67. public function agent(): HasOne
  68. {
  69. return $this->hasOne("app\model\saas\SaasAgent",'agent_id','agent_id');
  70. }
  71. }