<?php
global $dou;

if (!$dou->value_exist('fragment', 'fragment_name', 'about')) {
    $dou->query("INSERT INTO dou_fragment VALUES(NULL,'首页关于我们形象图','about','0','rasnk4e.file','','','0')");
    $dou->query("INSERT INTO dou_fragment VALUES(NULL,'微信二维码','weixin','1','yx1cj8z.file','','','0')");
    $dou->query("INSERT INTO dou_file VALUES(NULL,'rasnk4e.file','images/fragment/about.jpg','fragment','1','main','51970','0','1590637618','1590637618')");
    $dou->query("INSERT INTO dou_file VALUES(NULL,'yx1cj8z.file','images/fragment/weixin.png','fragment','2','main','5934','0','1590637634','1590637634')");
}

if (!$dou->field_exist('show', 'show_text')) {
    $dou->query("ALTER TABLE " . $dou->table('show') . " ADD `show_text` TEXT NOT NULL DEFAULT '' AFTER `show_img`");
}
if (!$dou->field_exist('product', 'stock')) {
    $dou->query("ALTER TABLE " . $dou->table('product') . " ADD `stock` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0' AFTER `price`");
}
if (!$dou->field_exist('nav', 'icon')) {
    $dou->query("ALTER TABLE " . $dou->table('nav') . " ADD `icon` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `nav_name`");
}
if (!$dou->field_exist('product_category', 'icon')) {
    $dou->query("ALTER TABLE " . $dou->table('product_category') . " ADD `icon` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `cat_name`");
}

?>