2013-11-29 13:09:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class ActivityController extends \BaseController {
|
|
|
|
|
2013-12-04 17:20:14 +01:00
|
|
|
public function getDatatable($clientPublicId)
|
2013-11-29 13:09:21 +01:00
|
|
|
{
|
2013-12-04 17:20:14 +01:00
|
|
|
$clientId = Client::getPrivateId($clientPublicId);
|
|
|
|
|
2013-12-03 18:32:33 +01:00
|
|
|
return Datatable::collection(Activity::scope()->where('client_id','=',$clientId)->get())
|
2013-12-07 21:33:07 +01:00
|
|
|
->addColumn('date', function($model) { return Utils::timestampToDateString($model->created_at); })
|
2013-12-01 21:58:25 +01:00
|
|
|
->addColumn('message', function($model) { return $model->message; })
|
|
|
|
->addColumn('balance', function($model) { return '$' . $model->balance; })
|
|
|
|
->orderColumns('date')
|
2013-11-29 13:09:21 +01:00
|
|
|
->make();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|