Reputation: 17
what is the error in code? please help me
$query = new Query;
$dataProvider = new ActiveDataProvider([
'query'=> $query
->select(['vchr_name','vchr_actual_hours','vchr_worked_hours','fk_int_payroll_month','fk_int_payroll_year'])
->from('tbl_payroll')
->join(['INNER JOIN','tbl_employee', 'TblEmployee.pk_int_emp_id=TblPayroll.fk_int_emp_id'])
->where(['pk_int_payroll_id'=> $id])
->One(),
]);
Upvotes: 0
Views: 430
Reputation: 728
As per the documentation at http://www.yiiframework.com/doc-2.0/yii-db-query.html#join()-detail there should be 4 parameters of join(). In your case it should be
->join('INNER JOIN','tbl_employee', 'TblEmployee.pk_int_emp_id=TblPayroll.fk_int_emp_id', [])
or you can omit the last 4th non mandatory parameter.
Upvotes: 1