Hello,
Getting the following error displayed on the page when attempting to display a field gotten from a left join, any ideas?
Displayed Error:
Warning: array_merge(): Argument #1 is not an array in /srv/users/serverpilot/apps/mobility-exchange/public/test_portal/vendor/koolphp/koolreport/koolreport/widgets/koolphp/Table.php on line 220
Class File
class ApprovedDevices extends \koolreport\KoolReport
{
public function settings()
{
return array(
"dataSources"=>array(
"ApprovedDevices"=>array(
"connectionString"=>"mysql:host=" . DB_HOST . ";dbname=" . DB_NAME,
"username"=>DB_USER,
"password"=>DB_PASS,
"charset"=>"utf8"
)
)
);
}
public function setup()
{
$this->src('ApprovedDevices')->query(MYSQL::type(
DB::table('order_line_item')
->join('mco', 'order_line_item.mco_id', '=', 'mco.id')
->join('providers', 'order_line_item.provider_id', '=', 'providers.id')
->leftJoin('users', 'order_line_item.action_taken_by', '=', 'users.id')
->select('mco.name')->alias('mco_name')
->select('providers.name')->alias('provider_name')
->select('order_line_item.caregiver')
->select('order_line_item.member_id')
->select('order_line_item.tablet_id')
->select('order_line_item.phone_number')
->select('order_line_item.device_id')
->select('order_line_item.sim_id')
->select('order_line_item.shipping_address')
->select('order_line_item.tracking_number')
->select('order_line_item.ship_date')
->select('order_line_item.status')
->select('users.username')
->where('order_line_item.order_id', '=', $this->params["orderID"])
->where('order_line_item.approved', '=', 1)
))
->pipe($this->dataStore("ApprovedDevices"));
}
}
View File:
use \koolreport\widgets\koolphp\Table;
Table::create(array(
'dataStore'=>$this->dataStore('ApprovedDevices'),
'columns'=>array(
'mco_name'=>array(
'label'=>'MCO'
),
'provider_name'=>array(
'label'=>'Provider'
),
'caregiver'=>array(
'label'=>'Caregiver'
),
'member_id'=>array(
'label'=>'Member ID'
),
'tablet_id'=>array(
'label'=>'Tablet ID'
),
'phone_number'=>array(
'label'=>'Phone #'
),
'device_id'=>array(
'label'=>'Device ID'
),
'sim_id'=>array(
'label'=>'SIM ID'
),
'shipping_address'=>array(
'label'=>'Shipping Address'
),
'tracking_number'=>array(
'label'=>'Tracking Number'
),
'ship_date'=>array(
'label'=>'Shipping Date'
),
'status'=>array(
'label'=>'Status'
),
'username'=>array(
'label'=>'Approved By'
)
),
'cssClass'=>array(
'table'=>'table table-hover table-bordered'
)
));