update
This commit is contained in:
@@ -86,6 +86,9 @@ class ChatController extends Controller
|
||||
foreach($dataChannel as $d){
|
||||
$user = User::with('detail')->where('nID', $d['member_id'])->first();
|
||||
$lastMessage = Message::where('channel_id', $d['id'])
|
||||
->where('type', '!=', 'summary')
|
||||
->where('type', '!=', 'trigger')
|
||||
|
||||
->latest('created_at')
|
||||
->first();
|
||||
$urlAvatarDefault = $user->detail->nIDJenisKelamin == 1 ? 'https://linksehat.dev/assets/img/users/male-avatar.png' : 'https://linksehat.dev/assets/img/users/female-avatar.png';
|
||||
@@ -262,9 +265,9 @@ class ChatController extends Controller
|
||||
}
|
||||
|
||||
$prescription = Prescription::where('livechat_id', $livechat->id)->first();
|
||||
$prescriptionItems = PrescriptionItem::with('drug')->where('prescription_id',$prescription->id)->get();
|
||||
$prescriptions = [];
|
||||
if ($prescriptionItems){
|
||||
if ($prescription){
|
||||
$prescriptionItems = PrescriptionItem::with('drug')->where('prescription_id',$prescription->id)->get();
|
||||
foreach($prescriptionItems as $item){
|
||||
$row['medicine'] = $item->drug->name;
|
||||
$row['direction'] = $item->direction;
|
||||
|
||||
Reference in New Issue
Block a user