# |
Feb 4th 2018, 00:18 |
ahmed_bodi |
@hmic, ok so ive mapped parent_id to my referrer_id field, and ive added the lft and rght fields. I've also run users->recover() and none of the fields are becoming populated so now im lost |
# |
Feb 4th 2018, 00:08 |
ahmed_bodi |
parent_id i imaging in my case would be referrer_id |
# |
Feb 4th 2018, 00:06 |
hmic |
;-) |
# |
Feb 4th 2018, 00:06 |
hmic |
which can be used to build the tree initially from existing data |
# |
Feb 4th 2018, 00:06 |
hmic |
parent_id is already there - might be different name |
# |
Feb 4th 2018, 00:06 |
ahmed_bodi |
will give it a shot sure |
# |
Feb 4th 2018, 00:05 |
hmic |
you got the idea now? |
# |
Feb 4th 2018, 00:05 |
ahmed_bodi |
ok so add lft and rght |
# |
Feb 4th 2018, 00:05 |
hmic |
and it would have been working already ;-) |
# |
Feb 4th 2018, 00:04 |
hmic |
and run repair on the tree with your current data |
# |
Feb 4th 2018, 00:04 |
ahmed_bodi |
fml coding on no sleep is screwing me over |
# |
Feb 4th 2018, 00:04 |
hmic |
just add the 2 fields to the users table |
# |
Feb 4th 2018, 00:04 |
hmic |
it ought to be easy for you |
# |
Feb 4th 2018, 00:04 |
ahmed_bodi |
... your kidding |
# |
Feb 4th 2018, 00:04 |
hmic |
should be the same now! |
# |
Feb 4th 2018, 00:03 |
ahmed_bodi |
correct |
# |
Feb 4th 2018, 00:03 |
hmic |
user and referer was the same table to start with, true? |
# |
Feb 4th 2018, 00:03 |
ahmed_bodi |
ah no, i split the referrer stuff out into its own table |
# |
Feb 4th 2018, 00:03 |
hmic |
which is the one we are talking about? your user table which holds a tree structure now |
# |
Feb 4th 2018, 00:03 |
ahmed_bodi |
dont i need the id of the referrer in the referrer table for the children query? |
# |
Feb 4th 2018, 00:03 |
ahmed_bodi |
that was the get of the user id |
# |
Feb 4th 2018, 00:02 |
hmic |
so you need to have the id at hand |
# |
Feb 4th 2018, 00:02 |
hmic |
you had a get() before with the id |
# |
Feb 4th 2018, 00:02 |
hmic |
i dont follow |
# |
Feb 4th 2018, 00:02 |
ahmed_bodi |
:p |
# |
Feb 4th 2018, 00:02 |
ahmed_bodi |
right but that means i have to run the get on the referrer first to get the id of the referer for the user and then run children for the children |
# |
Feb 3rd 2018, 23:59 |
hmic |
:P |
# |
Feb 3rd 2018, 23:59 |
hmic |
like ->get() you used before does too |
# |
Feb 3rd 2018, 23:59 |
ahmed_bodi |
the children finder seems to require the id of the node it seems? |
# |
Feb 3rd 2018, 23:58 |
hmic |
it's all on the page i linked |
# |
Feb 3rd 2018, 23:58 |
hmic |
why dont you use the children finder then? |
# |
Feb 3rd 2018, 23:58 |
ahmed_bodi |
any ideas? |
# |
Feb 3rd 2018, 23:57 |
ahmed_bodi |
which is showing as null in the object |
# |
Feb 3rd 2018, 23:57 |
ahmed_bodi |
now thats only showing me the referral with that id, i want all the children too |
# |
Feb 3rd 2018, 23:57 |
ahmed_bodi |
$referrals = $this->Referrals->find('threaded', ['contain' => 'Users'])->where(['user_id' => $user_obj->referral_id]); |
# |
Feb 3rd 2018, 23:57 |
ahmed_bodi |
@hmic so this is what im doing |
# |
Feb 3rd 2018, 23:51 |
popperz0r |
ok thanks! :slightly_smiling_face: |
# |
Feb 3rd 2018, 23:50 |
hmic |
seems like its legit and just add that functionality for windows users |
# |
Feb 3rd 2018, 23:50 |
hmic |
so you might understand |
# |
Feb 3rd 2018, 23:50 |
hmic |
read whats in the github repo |
# |
Feb 3rd 2018, 23:50 |
hmic |
remove the package from your composer.json |