|
@@ -44,7 +44,30 @@ class TransportationController extends Controller
|
44
|
44
|
|
45
|
45
|
public function getByUser($user_id)
|
46
|
46
|
{
|
47
|
|
- $query = Transportation::where('user_id', Helper::hash($user_id, 'decode'))->findOrFail();
|
|
47
|
+ $query = Transportation::where('user_id', Helper::hash($user_id, 'decode'))->get();
|
|
48
|
+
|
|
49
|
+ if($query){
|
|
50
|
+ $result = $query;
|
|
51
|
+
|
|
52
|
+ $res_status = true;
|
|
53
|
+ $msg = 'Mendapatkan Data';
|
|
54
|
+ $status_msg = $msg;
|
|
55
|
+
|
|
56
|
+ return $this->resSuccess(null, $res_status, $msg, $status_msg, $result);
|
|
57
|
+
|
|
58
|
+ }else {
|
|
59
|
+
|
|
60
|
+ $res_status = false;
|
|
61
|
+ $msg = 'Data tidak ditemukan';
|
|
62
|
+ $status_msg = $msg;
|
|
63
|
+
|
|
64
|
+ return $this->resSuccess(null, $res_status, $msg, $status_msg, null);
|
|
65
|
+ }
|
|
66
|
+ }
|
|
67
|
+
|
|
68
|
+ public function getSingle($data_id)
|
|
69
|
+ {
|
|
70
|
+ $query = Transportation::where('id', Helper::hash($data_id, 'decode'))->get();
|
48
|
71
|
|
49
|
72
|
if($query){
|
50
|
73
|
$result = $query;
|