-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 10.252.250.130
-- Generation Time: 2017-08-03 09:55:25
-- 服务器版本： 10.0.17-MariaDB-1~trusty-log
-- PHP Version: 7.0.15-0ubuntu0.16.04.4

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `zhsso`
--

-- --------------------------------------------------------

--
-- 表的结构 `sc_user`
--

CREATE TABLE `sc_user` (
  `sid` int(10) NOT NULL,
  `uid` int(10) NOT NULL,
  `Name` varchar(64) NOT NULL,
  `MobileNum` varchar(20) NOT NULL,
  `Company` varchar(255) NOT NULL,
  `PhoneNum` varchar(20) NOT NULL,
  `QQ` varchar(15) NOT NULL,
  `Province` varchar(20) CHARACTER SET ucs2 NOT NULL,
  `Address` varchar(255) NOT NULL,
  `KnowFrom` int(10) NOT NULL,
  `KnowOther` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `wk_pay_account`
--

CREATE TABLE `wk_pay_account` (
  `id` mediumint(8) UNSIGNED NOT NULL,
  `trade_sn` char(50) NOT NULL,
  `userid` mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
  `username` char(20) NOT NULL,
  `contactname` char(50) NOT NULL,
  `email` char(40) NOT NULL,
  `telephone` char(20) NOT NULL,
  `discount` float(8,2) NOT NULL DEFAULT '0.00',
  `money` char(8) NOT NULL,
  `quantity` int(8) UNSIGNED NOT NULL DEFAULT '1',
  `addtime` int(10) NOT NULL DEFAULT '0',
  `paytime` int(10) NOT NULL DEFAULT '0',
  `usernote` char(255) NOT NULL,
  `pay_id` smallint(4) NOT NULL,
  `pay_type` enum('offline','recharge','selfincome','online','alipay','voucher') NOT NULL DEFAULT 'recharge',
  `payment` char(90) NOT NULL,
  `type` tinyint(3) NOT NULL DEFAULT '1',
  `ip` char(15) NOT NULL DEFAULT '0.0.0.0',
  `status` enum('succ','failed','error','progress','timeout','cancel','waitting','unpay') NOT NULL DEFAULT 'unpay',
  `adminnote` char(20) NOT NULL,
  `checker` varchar(40) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `zh_emailList`
--

CREATE TABLE `zh_emailList` (
  `eid` int(11) NOT NULL,
  `Email1` longtext NOT NULL,
  `Email2` longtext NOT NULL,
  `Email3` longtext NOT NULL,
  `Email4` longtext NOT NULL,
  `Email5` longtext NOT NULL,
  `EmailName1` longtext NOT NULL,
  `EmailName2` longtext NOT NULL,
  `EmailName3` longtext NOT NULL,
  `EmailName4` longtext NOT NULL,
  `EmailName5` longtext NOT NULL,
  `stype` int(2) NOT NULL DEFAULT '1',
  `title` varchar(255) NOT NULL,
  `content` longtext NOT NULL,
  `time` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `zh_email_task`
--

CREATE TABLE `zh_email_task` (
  `tid` int(10) NOT NULL,
  `email_title` varchar(200) NOT NULL,
  `email_content` text NOT NULL,
  `is_send_count` int(10) NOT NULL,
  `status` int(1) NOT NULL,
  `send_count` int(10) NOT NULL,
  `time` int(10) NOT NULL,
  `faild_uid` text NOT NULL,
  `de_email` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `zh_income_pay`
--

CREATE TABLE `zh_income_pay` (
  `id` int(11) UNSIGNED NOT NULL,
  `uid` int(11) UNSIGNED NOT NULL COMMENT '通行账号id',
  `type` tinyint(1) UNSIGNED NOT NULL COMMENT '收入还是支出，1：收入，2：支出',
  `money` decimal(10,2) NOT NULL,
  `comefrom` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '来源',
  `description` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '描述',
  `addtime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '账单创建时间'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='账单表';

-- --------------------------------------------------------

--
-- 表的结构 `zh_manager`
--

CREATE TABLE `zh_manager` (
  `id` smallint(5) NOT NULL,
  `username` char(15) CHARACTER SET utf8 NOT NULL,
  `password` char(32) CHARACTER SET utf8 NOT NULL,
  `groups` enum('admin','members') CHARACTER SET utf8 NOT NULL,
  `salt` char(6) CHARACTER SET utf8 NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- 表的结构 `zh_mobile_code`
--

CREATE TABLE `zh_mobile_code` (
  `id` int(11) UNSIGNED NOT NULL,
  `mobile` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `time` int(15) UNSIGNED NOT NULL,
  `code` varchar(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `zh_sales_record`
--

CREATE TABLE `zh_sales_record` (
  `id` int(11) NOT NULL,
  `salename` char(255) NOT NULL COMMENT '销售人员姓名',
  `promocode` char(255) NOT NULL COMMENT '优惠码',
  `total` char(255) NOT NULL DEFAULT '0' COMMENT '累计金额',
  `usez` char(255) NOT NULL DEFAULT '0' COMMENT '已提取金额'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `zh_sales_withdrawal_slip`
--

CREATE TABLE `zh_sales_withdrawal_slip` (
  `id` int(11) NOT NULL,
  `salename` char(255) NOT NULL,
  `total` char(255) NOT NULL DEFAULT '0',
  `usez` char(255) NOT NULL DEFAULT '0',
  `curr` char(255) NOT NULL,
  `opuser` char(255) NOT NULL,
  `optime` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `zh_users`
--

CREATE TABLE `zh_users` (
  `id` mediumint(8) NOT NULL,
  `nicename` char(50) NOT NULL,
  `username` char(50) NOT NULL,
  `useremail` char(32) NOT NULL,
  `mobile` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `userpasswd` char(32) NOT NULL,
  `userquestion` char(255) NOT NULL,
  `defquestion` char(255) NOT NULL,
  `useranswer` char(255) NOT NULL,
  `actstate` char(255) DEFAULT NULL,
  `salt` char(6) NOT NULL,
  `keys_auth` char(10) DEFAULT NULL,
  `regip` char(15) NOT NULL,
  `regdate` int(10) UNSIGNED NOT NULL,
  `lastloginip` int(10) UNSIGNED NOT NULL,
  `lastlogintime` int(10) UNSIGNED NOT NULL,
  `uptime` int(11) UNSIGNED NOT NULL,
  `intime` int(11) UNSIGNED NOT NULL,
  `bank` decimal(10,2) NOT NULL DEFAULT '0.00'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `zh_users_activity`
--

CREATE TABLE `zh_users_activity` (
  `aid` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `money` smallint(6) NOT NULL,
  `joindate` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- 表的结构 `zh_users_old`
--

CREATE TABLE `zh_users_old` (
  `id` mediumint(8) NOT NULL,
  `nicename` char(50) NOT NULL,
  `username` char(50) NOT NULL,
  `useremail` char(32) NOT NULL,
  `userpasswd` char(32) NOT NULL,
  `userquestion` char(255) NOT NULL,
  `defquestion` char(255) NOT NULL,
  `useranswer` char(255) NOT NULL,
  `actstate` char(255) DEFAULT NULL,
  `salt` char(6) NOT NULL,
  `regip` char(15) NOT NULL,
  `regdate` int(10) UNSIGNED NOT NULL,
  `lastloginip` int(10) UNSIGNED NOT NULL,
  `lastlogintime` int(10) UNSIGNED NOT NULL,
  `uptime` int(11) UNSIGNED NOT NULL,
  `intime` int(11) UNSIGNED NOT NULL,
  `bank` decimal(10,2) NOT NULL DEFAULT '0.00'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `zh_users_payway`
--

CREATE TABLE `zh_users_payway` (
  `id` int(10) UNSIGNED NOT NULL,
  `uid` int(10) UNSIGNED NOT NULL,
  `idbank` char(255) NOT NULL,
  `idalipay` char(255) NOT NULL,
  `idtenpay` char(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- 表的结构 `zh_users_switch`
--

CREATE TABLE `zh_users_switch` (
  `uid` mediumint(9) NOT NULL,
  `actcode` char(32) NOT NULL,
  `rndcode` char(6) NOT NULL,
  `actime` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `zh_users_verify`
--

CREATE TABLE `zh_users_verify` (
  `vid` int(10) UNSIGNED NOT NULL,
  `uid` int(10) UNSIGNED NOT NULL,
  `status` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `realname` char(50) CHARACTER SET utf8 NOT NULL,
  `idcards` char(18) CHARACTER SET utf8 NOT NULL,
  `idcards_img1` char(255) NOT NULL,
  `idcards_img2` char(255) NOT NULL,
  `mobile` char(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- 表的结构 `zh_users_voucher`
--

CREATE TABLE `zh_users_voucher` (
  `id` int(11) UNSIGNED NOT NULL,
  `vid` int(11) UNSIGNED NOT NULL COMMENT '代金卷活动id',
  `userid` mediumint(8) UNSIGNED NOT NULL COMMENT '通行账号id',
  `vmoney` decimal(10,2) UNSIGNED NOT NULL COMMENT '代金卷金额',
  `addtime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '领取时间',
  `vname` varchar(150) COLLATE utf8_unicode_ci NOT NULL COMMENT '活动名称'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='用户-代金卷关系表';

-- --------------------------------------------------------

--
-- 表的结构 `zh_voucher`
--

CREATE TABLE `zh_voucher` (
  `id` int(11) UNSIGNED NOT NULL,
  `vname` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `vcode` varchar(6) COLLATE utf8_unicode_ci NOT NULL COMMENT '领取码',
  `vcost` decimal(10,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '金额',
  `vcount` int(10) UNSIGNED NOT NULL COMMENT '总量,0为无限',
  `vstarttime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '开始时间',
  `vendtime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '结束时间',
  `vaddtime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '添加时间',
  `status` tinyint(2) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0:未开始，1:进行中，2:已结束'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='代金券活动表';

--
-- Indexes for dumped tables
--

--
-- Indexes for table `sc_user`
--
ALTER TABLE `sc_user`
  ADD PRIMARY KEY (`sid`);

--
-- Indexes for table `wk_pay_account`
--
ALTER TABLE `wk_pay_account`
  ADD PRIMARY KEY (`id`),
  ADD KEY `status` (`status`),
  ADD KEY `userid` (`userid`),
  ADD KEY `trade_sn` (`trade_sn`,`money`,`status`,`id`);

--
-- Indexes for table `zh_emailList`
--
ALTER TABLE `zh_emailList`
  ADD PRIMARY KEY (`eid`),
  ADD UNIQUE KEY `eid` (`eid`);

--
-- Indexes for table `zh_email_task`
--
ALTER TABLE `zh_email_task`
  ADD PRIMARY KEY (`tid`);

--
-- Indexes for table `zh_income_pay`
--
ALTER TABLE `zh_income_pay`
  ADD PRIMARY KEY (`id`),
  ADD KEY `uid` (`uid`);

--
-- Indexes for table `zh_manager`
--
ALTER TABLE `zh_manager`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `zh_mobile_code`
--
ALTER TABLE `zh_mobile_code`
  ADD PRIMARY KEY (`id`),
  ADD KEY `mobile` (`mobile`);

--
-- Indexes for table `zh_sales_record`
--
ALTER TABLE `zh_sales_record`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `promocode` (`promocode`);

--
-- Indexes for table `zh_sales_withdrawal_slip`
--
ALTER TABLE `zh_sales_withdrawal_slip`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `zh_users`
--
ALTER TABLE `zh_users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD KEY `mobile` (`mobile`),
  ADD KEY `useremail` (`useremail`);

--
-- Indexes for table `zh_users_activity`
--
ALTER TABLE `zh_users_activity`
  ADD PRIMARY KEY (`aid`);

--
-- Indexes for table `zh_users_old`
--
ALTER TABLE `zh_users_old`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `zh_users_payway`
--
ALTER TABLE `zh_users_payway`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `zh_users_switch`
--
ALTER TABLE `zh_users_switch`
  ADD UNIQUE KEY `uid` (`uid`),
  ADD KEY `actcode` (`actcode`);

--
-- Indexes for table `zh_users_verify`
--
ALTER TABLE `zh_users_verify`
  ADD PRIMARY KEY (`vid`);

--
-- Indexes for table `zh_users_voucher`
--
ALTER TABLE `zh_users_voucher`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vid` (`vid`),
  ADD KEY `userid` (`userid`);

--
-- Indexes for table `zh_voucher`
--
ALTER TABLE `zh_voucher`
  ADD PRIMARY KEY (`id`);

--
-- 在导出的表使用AUTO_INCREMENT
--

--
-- 使用表AUTO_INCREMENT `sc_user`
--
ALTER TABLE `sc_user`
  MODIFY `sid` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26349;
--
-- 使用表AUTO_INCREMENT `wk_pay_account`
--
ALTER TABLE `wk_pay_account`
  MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7235;
--
-- 使用表AUTO_INCREMENT `zh_emailList`
--
ALTER TABLE `zh_emailList`
  MODIFY `eid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=89;
--
-- 使用表AUTO_INCREMENT `zh_email_task`
--
ALTER TABLE `zh_email_task`
  MODIFY `tid` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- 使用表AUTO_INCREMENT `zh_income_pay`
--
ALTER TABLE `zh_income_pay`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28494;
--
-- 使用表AUTO_INCREMENT `zh_manager`
--
ALTER TABLE `zh_manager`
  MODIFY `id` smallint(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- 使用表AUTO_INCREMENT `zh_mobile_code`
--
ALTER TABLE `zh_mobile_code`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20588;
--
-- 使用表AUTO_INCREMENT `zh_sales_record`
--
ALTER TABLE `zh_sales_record`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=50;
--
-- 使用表AUTO_INCREMENT `zh_sales_withdrawal_slip`
--
ALTER TABLE `zh_sales_withdrawal_slip`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;
--
-- 使用表AUTO_INCREMENT `zh_users`
--
ALTER TABLE `zh_users`
  MODIFY `id` mediumint(8) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=111150;
--
-- 使用表AUTO_INCREMENT `zh_users_activity`
--
ALTER TABLE `zh_users_activity`
  MODIFY `aid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=486;
--
-- 使用表AUTO_INCREMENT `zh_users_old`
--
ALTER TABLE `zh_users_old`
  MODIFY `id` mediumint(8) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2104;
--
-- 使用表AUTO_INCREMENT `zh_users_payway`
--
ALTER TABLE `zh_users_payway`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `zh_users_verify`
--
ALTER TABLE `zh_users_verify`
  MODIFY `vid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `zh_users_voucher`
--
ALTER TABLE `zh_users_voucher`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42;
--
-- 使用表AUTO_INCREMENT `zh_voucher`
--
ALTER TABLE `zh_voucher`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
