OrderReturn.php 667 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\model;
  3. use support\Model;
  4. class OrderReturn extends Model
  5. {
  6. protected $table = 'order_return';
  7. protected $primaryKey = 'orders_return_id';
  8. protected $dateFormat = 'U';
  9. const CREATED_AT = 'order_return_addtimes';
  10. const UPDATED_AT = null;
  11. public function member()
  12. {
  13. return $this->hasOne(Member::class, 'member_id', 'join_return_member_id');
  14. }
  15. public function cert()
  16. {
  17. return $this->hasOne(MemberCert::class, 'join_cert_member_id', 'join_return_member_id');
  18. }
  19. public function order()
  20. {
  21. return $this->hasOne(Order::class, 'order_id', 'join_return_order_id');
  22. }
  23. }