<?php // +---------------------------------------------------------------------- // | WE CAN DO IT JUST FREE // +---------------------------------------------------------------------- // | Copyright http://bbs.baijiacms.com Licensed under the Apache License, Version 2.0 // +---------------------------------------------------------------------- // | Author: 百家威信 <http://bbs.baijiacms.com> // +---------------------------------------------------------------------- $allrule = mysqld_selectall('SELECT * FROM ' . table('rule')); $account = mysqld_select('SELECT * FROM ' . table('user') . " WHERE id=:id", array(':id' => $_CMS['account']['id'])); $menurule = array(); $userRule = mysqld_selectall('SELECT * FROM ' . table('user_rule') . " WHERE uid=:uid", array(':uid' => $_CMS['account']['id'])); foreach ($allrule as $item) { foreach ($userRule as $rule) { if ($item['modname'] == $rule['modname'] && $item['moddo'] == $rule['moddo']) { $menurule[] = $item['modname'] . "-" . $item['moddo']; } } } $username = $_CMS['account']['username']; $settings = globaSetting(); $condition = ''; if (mysqld_fieldexists('modules', 'isdisable')) { $condition = ' and `isdisable`=0 '; } $modulelist = mysqld_selectall("SELECT *,'' as menus FROM " . table('modules') . " where 1=1 {$condition} order by displayorder"); foreach ($modulelist as $index => $module) { $modulelist[$index]['menus'] = mysqld_selectall("SELECT * FROM " . table('modules_menu') . " WHERE `module`=:module order by id", array(':module' => $module['name'])); } include page('main');
$sql = $sql . "ALTER TABLE " . table('member') . " ADD COLUMN `experience` int(11) DEFAULT '0' COMMENT '账户经验值';"; $sql = $sql . "update " . table('member') . " set experience=credit;"; } if (!mysqld_fieldexists('shop_goods', 'isfirst')) { $sql = $sql . "ALTER TABLE " . table('shop_goods') . " ADD COLUMN `isfirst` int(1) DEFAULT '0' COMMENT '首发';"; } if (!mysqld_fieldexists('shop_goods', 'isjingping')) { $sql = $sql . "ALTER TABLE " . table('shop_goods') . " ADD COLUMN `isjingping` int(1) DEFAULT '0' COMMENT '精品';"; } if (!mysqld_fieldexists('shop_order', 'hasbonus')) { $sql = $sql . "ALTER TABLE " . table('shop_order') . " ADD COLUMN `hasbonus` int(1) DEFAULT '0' COMMENT '是否使用优惠券';"; } if (!mysqld_fieldexists('shop_order', 'bonusprice')) { $sql = $sql . "ALTER TABLE " . table('shop_order') . " ADD COLUMN `bonusprice` decimal(10,2) DEFAULT '0.00' COMMENT '优惠券抵消金额';"; } if (!mysqld_fieldexists('member_paylog', 'account_fee')) { $sql = $sql . "ALTER TABLE " . table('member_paylog') . " ADD COLUMN `account_fee` decimal(10,2) NOT NULL COMMENT '账户剩余积分或余额';"; } mysqld_batch($sql); clear_theme_cache(); if (intval(SYSTEM_VERSION) <= 20150724) { mysqld_update('shop_dispatch', array('express' => 'cac'), array('sendtype' => 1, 'express' => '')); $shop_dispatchs = mysqld_selectall("select * from " . table('shop_dispatch') . " group by express"); foreach ($shop_dispatchs as $shop_dispatch) { $express_code = $shop_dispatch['express']; $shop_dispatch_area = mysqld_select("SELECT * FROM " . table('shop_dispatch_area') . " WHERE dispatchid=:dispatchid and provance=:provance and city=:city and area=:area limit 1", array('dispatchid' => $shop_dispatch['id'], 'country' => '中国', 'provance' => $shop_dispatch['provance'], 'city' => $shop_dispatch['city'], 'area' => $shop_dispatch['area'])); if (empty($shop_dispatch_area['id'])) { mysqld_insert("shop_dispatch_area", array('dispatchid' => $shop_dispatch['id'], 'country' => '中国', 'provance' => $shop_dispatch['provance'], 'city' => $shop_dispatch['city'], 'area' => $shop_dispatch['area'])); } $dispatch = mysqld_select("SELECT * FROM " . table('dispatch') . " WHERE code=:code limit 1", array(':code' => $express_code)); if (empty($dispatch['id'])) {
if (!mysqld_fieldexists('member', 'outgoldinfo')) { $sql = $sql . "ALTER TABLE " . table('member') . " ADD COLUMN `outgoldinfo` varchar(1000) DEFAULT '0' COMMENT '提款信息 序列化';"; } if (!mysqld_fieldexists('shop_order', 'isverify')) { $sql = $sql . "ALTER TABLE " . table('shop_order') . " ADD COLUMN `isverify` int(1) DEFAULT '0' COMMENT '是否是核销订单0否1是';"; } if (!mysqld_fieldexists('shop_order', 'verify_shopvname')) { $sql = $sql . "ALTER TABLE " . table('shop_order') . " ADD COLUMN `verify_shopvname` varchar(50) DEFAULT '' COMMENT '核销门店名称';"; } if (!mysqld_fieldexists('shop_order', 'verify_shopvid')) { $sql = $sql . "ALTER TABLE " . table('shop_order') . " ADD COLUMN `verify_shopvid` int(10) DEFAULT '0' COMMENT '核销门店id';"; } if (!mysqld_fieldexists('shop_order', 'verify_openid')) { $sql = $sql . "ALTER TABLE " . table('shop_order') . " ADD COLUMN `verify_openid` varchar(50) DEFAULT '' COMMENT '核销员openid';"; } if (!mysqld_fieldexists('shop_goods', 'isverify')) { $sql = $sql . "ALTER TABLE " . table('shop_goods') . " ADD COLUMN `isverify` int(1) DEFAULT '0' COMMENT '是否是核销产品0否1是';"; } mysqld_batch($sql); if (CUSTOM_VERSION == true && is_file(CUSTOM_ROOT . '/modules/updatesql.php')) { require CUSTOM_ROOT . '/modules/updatesql.php'; } clear_theme_cache(); if (intval(SYSTEM_VERSION) <= 20150724) { mysqld_update('shop_dispatch', array('express' => 'cac'), array('sendtype' => 1, 'express' => '')); $shop_dispatchs = mysqld_selectall("select * from " . table('shop_dispatch') . " group by express"); foreach ($shop_dispatchs as $shop_dispatch) { $express_code = $shop_dispatch['express']; $shop_dispatch_area = mysqld_select("SELECT * FROM " . table('shop_dispatch_area') . " WHERE dispatchid=:dispatchid and provance=:provance and city=:city and area=:area limit 1", array('dispatchid' => $shop_dispatch['id'], 'country' => '中国', 'provance' => $shop_dispatch['provance'], 'city' => $shop_dispatch['city'], 'area' => $shop_dispatch['area'])); if (empty($shop_dispatch_area['id'])) { mysqld_insert("shop_dispatch_area", array('dispatchid' => $shop_dispatch['id'], 'country' => '中国', 'provance' => $shop_dispatch['provance'], 'city' => $shop_dispatch['city'], 'area' => $shop_dispatch['area']));