|
|
@@ -52,6 +52,25 @@ SET @red_template_id := (
|
|
|
SELECT wtid FROM website_template WHERE config = @red_template_code ORDER BY wtid LIMIT 1
|
|
|
);
|
|
|
|
|
|
+SET @red_website_id := (
|
|
|
+ SELECT websiteid
|
|
|
+ FROM website
|
|
|
+ WHERE id_code = @red_website_id_code
|
|
|
+ ORDER BY websiteid
|
|
|
+ LIMIT 1
|
|
|
+);
|
|
|
+SET @red_website_id := COALESCE(
|
|
|
+ @red_website_id,
|
|
|
+ (
|
|
|
+ SELECT websiteid
|
|
|
+ FROM website
|
|
|
+ WHERE wtid = @red_template_id
|
|
|
+ AND (domains LIKE '%hxcs.feifan.net%' OR domains LIKE '%ffkj-screen-red.localhost%')
|
|
|
+ ORDER BY websiteid
|
|
|
+ LIMIT 1
|
|
|
+ )
|
|
|
+);
|
|
|
+
|
|
|
INSERT INTO website (
|
|
|
dcode, unitid, wtcode, wtid, parent_wid, name, `desc`, protocol, port, domains, catalog_uri,
|
|
|
logo, white_logo_file, seo_icon, seo_title, seo_keywords, seo_description, create_time, create_pid, id_code
|
|
|
@@ -80,10 +99,19 @@ SELECT
|
|
|
FROM website bw
|
|
|
WHERE bw.websiteid = @blue_website_id
|
|
|
AND @red_template_id IS NOT NULL
|
|
|
+ AND @red_website_id IS NULL
|
|
|
AND NOT EXISTS (SELECT 1 FROM website WHERE id_code = @red_website_id_code);
|
|
|
|
|
|
SET @red_website_id := (
|
|
|
- SELECT websiteid FROM website WHERE id_code = @red_website_id_code ORDER BY websiteid LIMIT 1
|
|
|
+ SELECT websiteid
|
|
|
+ FROM website
|
|
|
+ WHERE id_code = @red_website_id_code
|
|
|
+ OR (
|
|
|
+ wtid = @red_template_id
|
|
|
+ AND (domains LIKE '%hxcs.feifan.net%' OR domains LIKE '%ffkj-screen-red.localhost%')
|
|
|
+ )
|
|
|
+ ORDER BY websiteid
|
|
|
+ LIMIT 1
|
|
|
);
|
|
|
|
|
|
UPDATE website rw
|
|
|
@@ -199,6 +227,40 @@ WHERE bn.wnccode = 10000
|
|
|
AND rn.idcard = bn.idcard
|
|
|
);
|
|
|
|
|
|
+INSERT INTO website_navigation (
|
|
|
+ dcode, unitid, wnccode, websiteid, wtid, idcard, name, name_assistant, title, `desc`,
|
|
|
+ wntcode, wnscode, wnjtcode, wnlscode, uri, url, jump_url, jump_websiteid, parent_nid,
|
|
|
+ photo_size_width, photo_size_height, background_image, sort_number, create_time, create_pid
|
|
|
+)
|
|
|
+SELECT
|
|
|
+ tn.dcode, tn.unitid, 10000, @red_website_id, NULL, tn.idcard, tn.name, tn.name_assistant, tn.title, tn.`desc`,
|
|
|
+ tn.wntcode, tn.wnscode, tn.wnjtcode, tn.wnlscode, tn.uri, tn.url, tn.jump_url, tn.jump_websiteid, NULL,
|
|
|
+ tn.photo_size_width, tn.photo_size_height, tn.background_image, tn.sort_number, NOW(), 10000
|
|
|
+FROM website_navigation tn
|
|
|
+WHERE tn.wnccode = 10010
|
|
|
+ AND tn.wtid = @red_template_id
|
|
|
+ AND @red_website_id IS NOT NULL
|
|
|
+ AND NOT EXISTS (
|
|
|
+ SELECT 1 FROM website_navigation rn
|
|
|
+ WHERE rn.wnccode = 10000
|
|
|
+ AND rn.websiteid = @red_website_id
|
|
|
+ AND rn.idcard = tn.idcard
|
|
|
+ );
|
|
|
+
|
|
|
+UPDATE website_navigation rn
|
|
|
+JOIN website_navigation tn ON tn.wnccode = 10010
|
|
|
+ AND tn.wtid = @red_template_id
|
|
|
+ AND tn.idcard = rn.idcard
|
|
|
+LEFT JOIN website_navigation tp ON tp.wnccode = 10010
|
|
|
+ AND tp.wtid = @red_template_id
|
|
|
+ AND tp.navigationid = tn.parent_nid
|
|
|
+LEFT JOIN website_navigation rp ON rp.wnccode = 10000
|
|
|
+ AND rp.websiteid = @red_website_id
|
|
|
+ AND rp.idcard = tp.idcard
|
|
|
+SET rn.parent_nid = CASE WHEN tp.navigationid IS NULL THEN NULL ELSE rp.navigationid END
|
|
|
+WHERE rn.wnccode = 10000
|
|
|
+ AND rn.websiteid = @red_website_id;
|
|
|
+
|
|
|
UPDATE website_navigation rn
|
|
|
JOIN website_navigation bn ON bn.wnccode = 10000
|
|
|
AND bn.websiteid = @blue_website_id
|