Update TTCrud.php
This commit is contained in:
@@ -84,21 +84,19 @@ class TTCrud extends mfBaseController {
|
||||
* @return array
|
||||
*/
|
||||
protected function getCrudConfig(): array {
|
||||
if (method_exists($this, 'prepareCrudConfig')) {
|
||||
$this->prepareCrudConfig();
|
||||
}
|
||||
|
||||
|
||||
$column = array_search('createBy', array_column($this->columns, 'key'));
|
||||
if ($column !== false &&
|
||||
isset($this->columns[$column]['modal']['items']) &&
|
||||
is_array($this->columns[$column]['modal']['items']) &&
|
||||
count($this->columns[$column]['modal']['items']) > 0
|
||||
) {
|
||||
if ($column !== false) {
|
||||
$this->columns[$column]['modal']['items'] = array_map(function ($user) {
|
||||
return ['value' => intval($user->id), 'text' => $user->name];
|
||||
}, UserModel::search(['employee' => true]));
|
||||
}
|
||||
|
||||
if (method_exists($this, 'prepareCrudConfig')) {
|
||||
$this->prepareCrudConfig();
|
||||
}
|
||||
|
||||
|
||||
$columns = array_map(function ($column) {
|
||||
if (isset($column['type']) && (!isset($column['modal']) || !isset($column['modal']['type']))) {
|
||||
|
||||
Reference in New Issue
Block a user