samedi 12 décembre 2020

How to query department wise doctor list according to their priority?

Suppose I have two tables Doctor & Doctor_department

a(priority=1), 
b(priority=2), 
c(priority=3)

In Doctor table there also have some doctor list with priority under those departments

d1(prority=1, dpearmtent=a),
d2(prority=2, dpearmtent=a),
d3(prority=3, dpearmtent=a),
d4(prority=4, dpearmtent=b),
d5(prority=5, dpearmtent=b),
d6(prority=6, dpearmtent=c),
d7(prority=7, dpearmtent=c)

I want to query all doctors according to department and priority like below format

(a(d1,d2,d3)),
(b(d4,d5)),
(c(d6,d7))

How to query to retrieve data like above format in Laravel.

Please help. Thanks in advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire