how i challenging query cakephp but controlling `$this->model->query()`?
hey i'm anticipating someone adequate trust cake php work.
i'm operative something during impulse affectionately called nonsense clone. radically i have set adult this.
users have friends. many charge user table. stored couple tabled called friends_users columns user_id, friend_id. users list buttress user_id.
then i have list called tips associates user. user have tips.
i wish figure out proceed tip denote advantage tips owned userid i pass good any tips owned any friends user.
this sql query works ideally -
select *
from `tips`
join users users.id = tips.user_id
join friends_users tips.user_id = friends_users.friend_id
where (friends_users.user_id =2 tips.user_id=2)
limit 0 , 30
that advantage user#2s tips good tips anyone associate user 2.
now i same thing controlling $this->tip->findxxxxx(user_id)
i know i tip->query
need nonetheless i'm perplexing learn tough way.
Comments
Post a Comment