-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
All data from query result wont simply return the all column of the data, resulting only show the data which is came from add() method (but the amount of data is correct).
As my investigation goes, this is caused by table which is placed on different schema (for ex: the data shown up if the table is from "public" schema instead of "other_public" schema)
My Code
In controller
$db = db_connect();
$query = $this->table('other_public.users')
return DataTable::of($builder)
->add('my_custom_field', function($row) {
return 'some text'
})
->toJson(true);
if using model, here is what it looks like:
Model
class Announcement extends Model
{
protected $DBGroup = 'default';
protected $table = 'cms.announcements';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'object';
}
Controller
class Announcement extends BaseController
{
protected $announcement_model;
function __construct()
{
$this->announcement_model = new ModelsAnnouncement();
}
public function index()
{
return DataTable::of($query)
->add('my_custom_field', function($row) {
return 'some text';
})
->toJson(true);
}
}
but if you check the query result using dd or whatever, it shows all the data
- PHP Version: 7.4
- CodeIgniter version: 4.3.6
- Library version: 0.6.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
