update v1.0.5.2
This commit is contained in:
@@ -76,7 +76,13 @@ class UserController extends Controller {
|
||||
->orderColumns('user_name', 'email')
|
||||
/* column username */
|
||||
->addColumn('user_name', function ($model) {
|
||||
return $model->user_name;
|
||||
if(strlen($model->user_name) > 20) {
|
||||
$username = substr($model->user_name, 0, 30);
|
||||
$username = substr($username, 0, strrpos($username, ' ')).' ...';
|
||||
} else {
|
||||
$username = $model->user_name;
|
||||
}
|
||||
return $username;
|
||||
})
|
||||
/* column email */
|
||||
->addColumn('email', function ($model) {
|
||||
@@ -96,7 +102,7 @@ class UserController extends Controller {
|
||||
$phone = $phone ." ". $mobile;
|
||||
return $phone;
|
||||
})
|
||||
/* column status */
|
||||
/* column account status */
|
||||
->addColumn('status', function ($model) {
|
||||
$status = $model->active;
|
||||
if($status == 1) {
|
||||
@@ -106,6 +112,16 @@ class UserController extends Controller {
|
||||
}
|
||||
return $stat;
|
||||
})
|
||||
/* column ban status */
|
||||
->addColumn('ban', function ($model) {
|
||||
$status = $model->ban;
|
||||
if($status == 1) {
|
||||
$stat = '<button class="btn btn-danger btn-xs">Banned</button>';
|
||||
} else {
|
||||
$stat = '<button class="btn btn-success btn-xs">Active</button>';
|
||||
}
|
||||
return $stat;
|
||||
})
|
||||
/* column last login date */
|
||||
->addColumn('lastlogin', function ($model) {
|
||||
$t = $model->updated_at;
|
||||
|
Reference in New Issue
Block a user