@@ -19,28 +19,28 @@ |
||
19 | 19 | ->get(); |
20 | 20 | |
21 | 21 | return \DataTables::of($new_upload) |
22 | - ->addColumn('checkbox', function ($model) { |
|
22 | + ->addColumn('checkbox', function($model) { |
|
23 | 23 | return "<input type='checkbox' class='upload_checkbox' value=".$model->id.' name=select[] id=checks>'; |
24 | 24 | }) |
25 | 25 | |
26 | - ->addColumn('product_id', function ($model) { |
|
26 | + ->addColumn('product_id', function($model) { |
|
27 | 27 | return ucfirst($this->product->where('id', $model->product_id)->first()->name); |
28 | 28 | }) |
29 | 29 | |
30 | - ->addColumn('title', function ($model) { |
|
30 | + ->addColumn('title', function($model) { |
|
31 | 31 | return ucfirst($model->title); |
32 | 32 | }) |
33 | - ->addColumn('description', function ($model) { |
|
33 | + ->addColumn('description', function($model) { |
|
34 | 34 | return ucfirst($model->description); |
35 | 35 | }) |
36 | - ->addColumn('version', function ($model) { |
|
36 | + ->addColumn('version', function($model) { |
|
37 | 37 | return $model->version; |
38 | 38 | }) |
39 | 39 | |
40 | - ->addColumn('file', function ($model) { |
|
40 | + ->addColumn('file', function($model) { |
|
41 | 41 | return $model->file; |
42 | 42 | }) |
43 | - ->addColumn('action', function ($model) { |
|
43 | + ->addColumn('action', function($model) { |
|
44 | 44 | return "<p><button data-toggle='modal' |
45 | 45 | data-id=".$model->id." data-title='$model->title' data-description='$model->description' data-version='$model->version'data-file='$model->file' |
46 | 46 | class='btn btn-sm btn-primary btn-xs editUploadsOption'><i class='fa fa-edit' |
@@ -105,16 +105,16 @@ discard block |
||
105 | 105 | |
106 | 106 | return \DataTables::of($query->take(50)) |
107 | 107 | ->setTotalRecords($query->count()) |
108 | - ->addColumn('checkbox', function ($model) { |
|
108 | + ->addColumn('checkbox', function($model) { |
|
109 | 109 | return "<input type='checkbox' class='order_checkbox' value=". |
110 | 110 | $model->id.' name=select[] id=check>'; |
111 | 111 | }) |
112 | - ->addColumn('date', function ($model) { |
|
112 | + ->addColumn('date', function($model) { |
|
113 | 113 | $date = $model->created_at; |
114 | 114 | |
115 | 115 | return "<span style='display:none'>$model->id</span>".$date; |
116 | 116 | }) |
117 | - ->addColumn('client', function ($model) { |
|
117 | + ->addColumn('client', function($model) { |
|
118 | 118 | $user = $this->user->where('id', $model->client)->first(); |
119 | 119 | $first = $user->first_name; |
120 | 120 | $last = $user->last_name; |
@@ -122,30 +122,30 @@ discard block |
||
122 | 122 | |
123 | 123 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'<a>'; |
124 | 124 | }) |
125 | - ->addColumn('productname', function ($model) { |
|
125 | + ->addColumn('productname', function($model) { |
|
126 | 126 | $productid = ($model->product); |
127 | 127 | $productName = Product::where('id', $productid)->pluck('name')->first(); |
128 | 128 | |
129 | 129 | return $productName; |
130 | 130 | }) |
131 | - ->addColumn('number', function ($model) { |
|
131 | + ->addColumn('number', function($model) { |
|
132 | 132 | return ucfirst($model->number); |
133 | 133 | }) |
134 | - ->addColumn('price_override', function ($model) { |
|
134 | + ->addColumn('price_override', function($model) { |
|
135 | 135 | $currency = $model->user()->find($model->client)->currency; |
136 | 136 | |
137 | 137 | return currency_format($model->price_override, $code = $currency); |
138 | 138 | }) |
139 | - ->addColumn('order_status', function ($model) { |
|
139 | + ->addColumn('order_status', function($model) { |
|
140 | 140 | return ucfirst($model->order_status); |
141 | 141 | }) |
142 | 142 | // ->showColumns('number', 'price_override', 'order_status') |
143 | - ->addColumn('update_ends_at', function ($model) { |
|
143 | + ->addColumn('update_ends_at', function($model) { |
|
144 | 144 | $end = $this->getEndDate($model); |
145 | 145 | |
146 | 146 | return $end; |
147 | 147 | }) |
148 | - ->addColumn('action', function ($model) { |
|
148 | + ->addColumn('action', function($model) { |
|
149 | 149 | $sub = $model->subscription()->first(); |
150 | 150 | $status = $this->checkInvoiceStatusByOrderId($model->id); |
151 | 151 | $url = $this->getUrl($model, $status, $sub); |
@@ -153,30 +153,30 @@ discard block |
||
153 | 153 | return $url; |
154 | 154 | }) |
155 | 155 | |
156 | - ->filterColumn('created_at', function ($query, $keyword) { |
|
156 | + ->filterColumn('created_at', function($query, $keyword) { |
|
157 | 157 | $sql = 'created_at like ?'; |
158 | 158 | $query->whereRaw($sql, ["%{$keyword}%"]); |
159 | 159 | }) |
160 | 160 | |
161 | - ->filterColumn('client', function ($query, $keyword) { |
|
161 | + ->filterColumn('client', function($query, $keyword) { |
|
162 | 162 | $sql = 'client like ?'; |
163 | 163 | $query->whereRaw($sql, ["%{$keyword}%"]); |
164 | 164 | }) |
165 | 165 | |
166 | - ->filterColumn('number', function ($query, $keyword) { |
|
166 | + ->filterColumn('number', function($query, $keyword) { |
|
167 | 167 | $sql = 'number like ?'; |
168 | 168 | $query->whereRaw($sql, ["%{$keyword}%"]); |
169 | 169 | }) |
170 | - ->filterColumn('price_override', function ($query, $keyword) { |
|
170 | + ->filterColumn('price_override', function($query, $keyword) { |
|
171 | 171 | $sql = 'price_override like ?'; |
172 | 172 | $query->whereRaw($sql, ["%{$keyword}%"]); |
173 | 173 | }) |
174 | - ->filterColumn('order_status', function ($query, $keyword) { |
|
174 | + ->filterColumn('order_status', function($query, $keyword) { |
|
175 | 175 | $sql = 'order_status like ?'; |
176 | 176 | $query->whereRaw($sql, ["%{$keyword}%"]); |
177 | 177 | }) |
178 | 178 | |
179 | - ->filterColumn('update_ends_at', function ($query, $keyword) { |
|
179 | + ->filterColumn('update_ends_at', function($query, $keyword) { |
|
180 | 180 | $sql = 'update_ends_at like ?'; |
181 | 181 | $query->whereRaw($sql, ["%{$keyword}%"]); |
182 | 182 | }) |