SaasOrder.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace app\model\saas;
  3. use app\extra\basic\Model;
  4. use think\model\relation\HasMany;
  5. use think\model\relation\HasOne;
  6. /**
  7. * @property integer $id (主键)
  8. * @property integer $shop_id 所属店铺
  9. * @property string $parent_id 消费店铺
  10. * @property string $order_sn
  11. * @property integer $money
  12. * @property integer $status 0待付款1已支付
  13. * @property integer $uuid
  14. * @property integer $pay_type 支付方式1微信2会员卡
  15. * @property string $print_name 打印机名称
  16. * @property integer $coupon_money 优惠券金额
  17. * @property integer $coupon_id
  18. * @property integer $notify_status 通知状态1已通知
  19. * @property mixed $pay_at 支付时间
  20. * @property string $transaction_id 交易编号wx
  21. * @property mixed $refund_at
  22. * @property integer $refund_status
  23. * @property integer $package 1店内打印2远程自取3商家配送
  24. * @property string $package_sn 取件号
  25. * @property integer $package_type 0无1店内打印2远程自取3商家配送
  26. * @property string $package_local 装订位置
  27. * @property integer $extra_money 额外加价
  28. * @property integer $express_money 配送费
  29. * @property integer $staple_money 装订费
  30. * @property float $discount 折扣
  31. * @property mixed $print_at 打印时间
  32. * @property string $remark 备注
  33. * @property string $reason 失败原因
  34. * @property mixed $create_at
  35. */
  36. class SaasOrder extends Model
  37. {
  38. /**
  39. * The connection name for the model.
  40. *
  41. * @var string|null
  42. */
  43. protected $connection = 'mysql';
  44. /**
  45. * The table associated with the model.
  46. *
  47. * @var string
  48. */
  49. protected string $table = "saas_order";
  50. /**
  51. * The primary key associated with the table.
  52. *
  53. * @var string
  54. */
  55. protected string $primaryKey = "id";
  56. /**
  57. * Indicates if the model should be timestamped.
  58. *
  59. * @var bool
  60. */
  61. public bool $timestamps = false;
  62. public function shop(): HasOne
  63. {
  64. return $this->hasOne("app\model\saas\SaasShop","shop_id","shop_id");
  65. }
  66. public function detail(): HasMany
  67. {
  68. return $this->hasMany("app\model\saas\SaasOrderDetail","order_sn",'order_sn');
  69. }
  70. }