-- 设置关系链上用户源头码 线上测试源头用 -- 源头用户ID 填写用户手机号 set @uid := (select user_id from d_user where phone = '13355558887');-- 源头码 填入源头码set @markid := 'l130428726971949';-- 设置关系链下用户源头码update d_user set other_source_mark = @markid where user_id in(select user_id from ( select t1.user_id, if(find_in_set(invite_user_id,@pids) > 0,@pids := concat(@pids,',user_id),0) as ischild from ( select user_id,invite_user_id from d_user_invite ) t1, (select @pids := @uid) t2 ) t3 where ischild != 0) and user_id != @uid and other_source_mark = '';-- 设置源头人源头码update d_user set own_source_mark = @markid where user_id = @uid and own_source_mark ='';