阅读背景:

根据CakePHP中的条件从两个表中获取数据

来源:互联网 

I have two controllers LeaveApplicationsController and EmployeesController. In LeaveApplicationsController index action I'm displaying leave records of all employees. It is showing fine but what I need is to show only login employees leaves to that employee. I have employee_id as foreign key in leave_applications table. But I am not getting employee_id (which is id) from employees table. I also have users table and each user has one employee associated with it. So when employee is created, before that user is created and newly created user's id is also stored in employees table under unser_id field. So user_id is foreign key in employees table and uniquely identifies the employee.I have two controllers LeaveApplicationsControl




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: