public function get_tugas($f3) { $post = $f3->get('POST'); $data = $f3->scrub($post); $id_kurir = $post['token']; $this->set_idLaundry($id_kurir); $orders = new \models\OrdersM(); $tugas = $orders->get_daftar_tugas($this->id_laundry); if (count($tugas) > 0) { foreach ($tugas as $t) { $listTugas[] = array("id" => $t->id, "id_user" => $t->id_user, "nama_user" => $t->nama_user, "alamat" => $t->alamat, "lokasi" => ["latitude" => $t->latitude, "longitude" => $t->longitude], "no_tlp" => $t->no_tlp, "jenis_layanan" => $t->jenis_layanan, "grand_total" => $t->grand_total, "produk" => json_decode($t->produk), "catatan" => $t->catatan, "waktu" => $t->dibuat, "status" => $t->status); } $this->set_code("01"); $this->set_msg("Daftar tugas"); $this->set_data("tugas", $listTugas); } else { $this->set_code("00"); $this->set_msg("Daftar tugas masih kosong"); $this->set_data("tugas", ["idKurir" => $id_kurir, "id" => $this->id_laundry, "count" => count($tugas)]); } $this->return_json(); }