Suggest.php 750 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zilongs
  5. * Date: 20-10-5
  6. * Time: 上午11:31
  7. */
  8. namespace App\Models;
  9. class Suggest extends BaseModel
  10. {
  11. public function order()
  12. {
  13. return $this->belongsTo(Order::class);
  14. }
  15. /**
  16. * 患者表联查
  17. * @return mixed
  18. */
  19. public function Patient()
  20. {
  21. return $this->hasOne(Patient::class,'id','patient_id');
  22. }
  23. /**
  24. * 意见详情表联查
  25. * @return mixed
  26. */
  27. public function details()
  28. {
  29. return $this->hasMany(SuggestDetail::class,'suggest_id','id');
  30. }
  31. /**
  32. * 获取用户信息
  33. * @return mixed
  34. */
  35. public function user()
  36. {
  37. return $this->hasOne(User::class,'id','user_id');
  38. }
  39. }