@ Роб Уилкерсон
UserInProject hasMany RegularPost
и RegularPost belongsTo UserInProject
И да, я перешел на уровень отладки 2.
Вот SQL-запросы:
SELECT `UserInProject`.`id`, `UserInProject`.`project_id`, `UserInProject`.`position_id`, `UserInProject`.`user_id`, `Project`.`id`, `Project`.`short_name`, `Project`.`full_name`, `Project`.`start_date`, `Project`.`end_date`, `Project`.`agreement_number`, `Project`.`active`, `Project`.`user_id`, `Position`.`id`, `Position`.`name`, `User`.`id`, `User`.`username`, `User`.`first_name`, `User`.`last_name`, `User`.`email`, `User`.`password`, `User`.`active`, `User`.`created`, `User`.`modified`, (CONCAT(`User`.`last_name`, " ", `User`.`first_name`, " (", `User`.`username` , ")")) AS `User__full_name` FROM `user_in_projects` AS `UserInProject` LEFT JOIN `projects` AS `Project` ON (`UserInProject`.`project_id` = `Project`.`id`) LEFT JOIN `positions` AS `Position` ON (`UserInProject`.`position_id` = `Position`.`id`) LEFT JOIN `users` AS `User` ON (`UserInProject`.`user_id` = `User`.`id`) WHERE `UserInProject`.`user_id` = 15
(этот запрос выполняется cakephp автоматически):
SELECT `RegularPost`.`id`, `RegularPost`.`date`, `RegularPost`.`size`, `RegularPost`.`users_in_project_id` FROM `regular_posts` AS `RegularPost` WHERE `RegularPost`.`users_in_project_id` IN (11, 20)
Итак, можно ли передать дату '2010-02-01' во второй запрос?