Erx.php 636 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Models;
  3. # use Illuminate\Database\Eloquent\Model;
  4. class Erx extends Model
  5. {
  6. protected $table = "erx";
  7. public function managerPro(){
  8. return $this->hasOne(Pro::class, 'id', 'manager_pro_id');
  9. }
  10. public function hcpPro(){
  11. return $this->hasOne(Pro::class, 'id', 'hcp_pro_id');
  12. }
  13. public function patient(){
  14. return $this->hasOne(Client::class, 'id', 'client_id');
  15. }
  16. public function client(){
  17. return $this->hasOne(Client::class, 'id', 'client_id');
  18. }
  19. public function note(){
  20. return $this->hasOne(Note::class, 'id', 'note_id');
  21. }
  22. }