Passed
Pull Request — master (#1275)
by
unknown
02:44
created
src/controllers/CBController/IndexAjax.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
         $table = request('table');
14 14
         $label = request('label');
15 15
         $datatableWhere = urldecode(request('datatable_where'));
16
-		$datatableFormat = urldecode(Request::get('datatable_format'));
16
+        $datatableFormat = urldecode(Request::get('datatable_format'));
17 17
         $foreignKeyName = request('fk_name');
18 18
         $foreignKeyValue = request('fk_value');
19 19
         if (! $table || ! $label || ! $foreignKeyName || ! $foreignKeyValue) {
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
         if ($datatableWhere) {
24 24
             $query->whereRaw($datatableWhere);
25 25
         }
26
-		if($datatableFormat) {
27
-			$label = $datatableFormat;
28
-			$query->select(DB::raw('id as select_value, CONCAT('.$label.') as select_label'));
29
-		} else {
30
-			$query->select('id as select_value',$label.' as select_label');
31
-		}
26
+        if($datatableFormat) {
27
+            $label = $datatableFormat;
28
+            $query->select(DB::raw('id as select_value, CONCAT('.$label.') as select_label'));
29
+        } else {
30
+            $query->select('id as select_value',$label.' as select_label');
31
+        }
32 32
         $query->where($foreignKeyName, $foreignKeyValue);
33 33
         $query->orderby('select_label', 'asc');
34 34
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,18 +16,18 @@  discard block
 block discarded – undo
16 16
 		$datatableFormat = urldecode(Request::get('datatable_format'));
17 17
         $foreignKeyName = request('fk_name');
18 18
         $foreignKeyValue = request('fk_value');
19
-        if (! $table || ! $label || ! $foreignKeyName || ! $foreignKeyValue) {
19
+        if (!$table || !$label || !$foreignKeyName || !$foreignKeyValue) {
20 20
             return response()->json([]);
21 21
         }
22 22
         $query = DB::table($table);
23 23
         if ($datatableWhere) {
24 24
             $query->whereRaw($datatableWhere);
25 25
         }
26
-		if($datatableFormat) {
26
+		if ($datatableFormat) {
27 27
 			$label = $datatableFormat;
28 28
 			$query->select(DB::raw('id as select_value, CONCAT('.$label.') as select_label'));
29 29
 		} else {
30
-			$query->select('id as select_value',$label.' as select_label');
30
+			$query->select('id as select_value', $label.' as select_label');
31 31
 		}
32 32
         $query->where($foreignKeyName, $foreignKeyValue);
33 33
         $query->orderby('select_label', 'asc');
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     public function getDataQuery()
58 58
     {
59 59
         $key = request('query');
60
-        if (! Cache::has($key)) {
60
+        if (!Cache::has($key)) {
61 61
             return response()->json(['items' => []]);
62 62
         }
63 63
         $query = Cache::get($key);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         if (request('q')) {
100 100
             return;
101 101
         }
102
-        $result->where(function ($where) use ($columns) {
102
+        $result->where(function($where) use ($columns) {
103 103
             foreach ($columns as $c => $col) {
104 104
                 if ($c == 0) {
105 105
                     $where->where($col, 'like', '%'.request('q').'%');
Please login to merge, or discard this patch.