MyGood.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace plugin\admin\app\model;
  3. use plugin\admin\app\model\Base;
  4. /**
  5. * @property integer $id (主键)
  6. * @property integer $user_id 会员ID
  7. * @property integer $goods_id 商品ID
  8. * @property string $money 购买金额
  9. * @property integer $pay_id 支付订单ID
  10. * @property integer $type 类型 1 分红产品 2定期产品
  11. * @property string $bonus 分红金额
  12. * @property string $refund_amount 退款金额
  13. * @property integer $is_grant 是否完结 1未完结 2已完结
  14. * @property integer $expiretime 到期时间戳
  15. * @property string $expiredate 到期时间
  16. * @property string $created_at 购买时间
  17. * @property string $updated_at 更新时间
  18. */
  19. class MyGood extends Base
  20. {
  21. /**
  22. * The table associated with the model.
  23. *
  24. * @var string
  25. */
  26. protected $table = 'wa_my_goods';
  27. /**
  28. * The primary key associated with the table.
  29. *
  30. * @var string
  31. */
  32. protected $primaryKey = 'id';
  33. public function goodsHasOne()
  34. {
  35. return $this->hasOne(Good::class,'id','goods_id');
  36. }
  37. public function userData()
  38. {
  39. return $this->hasOne(User::class,'id','user_id');
  40. }
  41. }