SELECT * FROM ( SELECT t1.*, IF ( FIND_IN_SET( parent_id, @parent_ids ) > 0, @parent_ids := CONCAT( @parent_ids, ',', id ), '0' ) AS ischild FROM ( SELECT * FROM blade_menu AS t WHERE t.is_deleted = 0 AND client_type = 'dianduyun_app' ORDER BY t.id ASC ) t1, ( SELECT @parent_ids := '1508255373140103170' ) t2 ) t3 WHERE ischild != '0'
SELECT rd.* FROM ( SELECT * FROM fine_authority_object WHERE parentId IS NOT NULL AND is_deleted = 0 ) rd, ( SELECT @pid := '2342465874553522423' ) pd WHERE FIND_IN_SET( parentId, @pid ) > 0 AND @pid := concat( @pid, ',', id )
UNION SELECT * FROM fine_authority_object WHERE FIND_IN_SET( id, @pid ) > 0;