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

--
-- 表的结构 `zjr_shop_coin_trans`
--

CREATE TABLE `zjr_shop_coin_trans` (
  `TransId` bigint(20) UNSIGNED NOT NULL,
  `OkFlag` varchar(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
  `UserId` bigint(13) UNSIGNED NOT NULL,
  `TransTmk` datetime NOT NULL,
  `TransAmt` bigint(20) NOT NULL,
  `TransCat` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
  `RefId` bigint(20) UNSIGNED NOT NULL,
  `TransMemo` varchar(50) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='购物币交易记录';

--
-- 转存表中的数据 `zjr_shop_coin_trans`
--

INSERT INTO `zjr_shop_coin_trans` (`TransId`, `OkFlag`, `UserId`, `TransTmk`, `TransAmt`, `TransCat`, `RefId`, `TransMemo`) VALUES
(1, '0', 4308211020301, '2015-12-01 19:06:41', 20, '45', 0, '注册成功赠送'),
(2, '0', 4308211020302, '2015-12-01 19:11:29', 20, '45', 0, '注册成功赠送'),
(3, '0', 4308211020303, '2015-12-01 19:18:17', 20, '45', 0, '注册成功赠送'),
(4, '0', 4308211020304, '2015-12-02 13:49:28', 20, '45', 0, '注册成功赠送'),
(5, '0', 4308211020305, '2015-12-02 14:26:15', 20, '45', 0, '注册成功赠送'),
(6, '0', 4308211020306, '2015-12-02 15:19:51', 20, '45', 0, '注册成功赠送'),
(7, '0', 4308211020313, '2015-12-02 15:50:53', 20, '45', 0, '注册成功赠送'),
(8, '0', 4308211020314, '2015-12-02 16:50:56', 20, '45', 0, '注册成功赠送'),
(9, '0', 4308211020315, '2015-12-02 19:06:16', 20, '45', 0, '注册成功赠送'),
(10, '0', 4308211020316, '2015-12-02 21:44:22', 20, '45', 0, '注册成功赠送'),
(11, '0', 4308211020306, '2015-12-02 21:49:37', 1, '61', 18, '幸运币兑换'),
(12, '0', 4308211020317, '2015-12-03 11:28:11', 20, '45', 0, '注册成功赠送'),
(13, '0', 4308211020314, '2015-12-03 13:13:17', 20, '45', 0, '注册成功赠送'),
(57, '0', 4308211020343, '2016-01-15 17:40:51', 20, '45', 0, '注册成功赠送'),
(58, '0', 4308211020344, '2016-01-16 15:02:56', 20, '45', 0, '注册成功赠送'),
(17, '0', 4308211020312, '2016-01-05 15:12:52', 20, '45', 0, '注册成功赠送'),
(53, '0', 4308211020340, '2016-01-13 19:38:54', 20, '45', 0, '注册成功赠送'),
(54, '0', 4308211020318, '2016-01-13 21:30:35', 20, '45', 0, '注册成功赠送'),
(49, '0', 4308211020319, '2016-01-13 14:55:40', 20, '45', 0, '注册成功赠送'),
(56, '0', 4308211020342, '2016-01-15 12:23:59', 20, '45', 0, '注册成功赠送'),
(51, '0', 4308211020339, '2016-01-13 16:38:10', 20, '45', 0, '注册成功赠送'),
(24, '0', 4308211020320, '2016-01-10 20:01:40', 20, '45', 0, '注册成功赠送'),
(25, '0', 4308211020321, '2016-01-10 20:15:59', 20, '45', 0, '注册成功赠送'),
(26, '0', 4308211020321, '2016-01-11 12:52:33', 20, '45', 0, '注册成功赠送'),
(27, '0', 4308211020322, '2016-01-11 13:03:44', 20, '45', 0, '注册成功赠送'),
(28, '0', 4308211020323, '2016-01-11 13:20:28', 20, '45', 0, '注册成功赠送'),
(29, '0', 4308211020324, '2016-01-11 14:05:50', 20, '45', 0, '注册成功赠送'),
(30, '0', 4308211020325, '2016-01-11 15:38:06', 20, '45', 0, '注册成功赠送'),
(31, '0', 4308211020326, '2016-01-11 16:01:36', 20, '45', 0, '注册成功赠送'),
(32, '0', 4308211020327, '2016-01-11 16:19:13', 20, '45', 0, '注册成功赠送'),
(33, '0', 4308211020326, '2016-01-11 16:57:59', 20, '45', 0, '注册成功赠送'),
(34, '0', 4308211020328, '2016-01-11 17:56:32', 20, '45', 0, '注册成功赠送'),
(35, '0', 4308211020329, '2016-01-11 19:23:25', 20, '45', 0, '注册成功赠送'),
(36, '0', 4308211020329, '2016-01-11 19:48:29', 2, '61', 28, '幸运币兑换'),
(37, '0', 4308211020330, '2016-01-11 21:31:35', 20, '45', 0, '注册成功赠送'),
(38, '0', 4308211020326, '2016-01-11 22:37:35', 20, '45', 0, '注册成功赠送'),
(39, '0', 4308211020327, '2016-01-11 23:10:58', 20, '45', 0, '注册成功赠送'),
(40, '0', 4308211020331, '2016-01-11 23:52:53', 20, '45', 0, '注册成功赠送'),
(41, '0', 4308211020332, '2016-01-12 12:24:15', 20, '45', 0, '注册成功赠送'),
(42, '0', 4308211020332, '2016-01-12 12:47:20', 9, '61', 38, '幸运币兑换'),
(43, '0', 4308211020333, '2016-01-12 14:51:28', 20, '45', 0, '注册成功赠送'),
(44, '0', 4308211020334, '2016-01-12 14:54:05', 20, '45', 0, '注册成功赠送'),
(45, '0', 4308211020335, '2016-01-12 15:33:42', 20, '45', 0, '注册成功赠送'),
(46, '0', 4308211020336, '2016-01-12 22:55:16', 20, '45', 0, '注册成功赠送'),
(47, '0', 4308211020337, '2016-01-13 10:58:30', 20, '45', 0, '注册成功赠送'),
(48, '0', 4308211020338, '2016-01-13 14:03:15', 20, '45', 0, '注册成功赠送'),
(59, '0', 4308211020345, '2016-01-17 14:36:45', 20, '45', 0, '注册成功赠送'),
(60, '0', 4308211020346, '2016-01-17 19:45:04', 20, '45', 0, '注册成功赠送'),
(61, '0', 4308211020347, '2016-01-17 20:22:16', 20, '45', 0, '注册成功赠送'),
(62, '0', 4308211020348, '2016-01-18 12:58:18', 20, '45', 0, '注册成功赠送'),
(63, '0', 4308211020349, '2016-01-18 13:10:22', 20, '45', 0, '注册成功赠送'),
(64, '0', 4308211020350, '2016-01-22 16:20:47', 20, '45', 0, '注册成功赠送'),
(65, '0', 4308211020302, '2016-01-28 19:52:55', 31, '61', 54, '幸运币兑换'),
(66, '0', 4308211020302, '2016-01-28 20:01:33', 207, '61', 103, '幸运币兑换'),
(67, '0', 4308211020351, '2016-01-29 00:35:54', 20, '45', 0, '注册成功赠送'),
(68, '0', 4308211020352, '2016-02-01 18:26:42', 20, '45', 0, '注册成功赠送'),
(69, '0', 4308211020352, '2016-02-01 18:58:48', 78, '61', 151, '幸运币兑换'),
(70, '0', 4308211020352, '2016-02-01 18:59:13', 100, '61', 152, '幸运币兑换'),
(71, '0', 4308211020353, '2016-02-05 15:25:09', 20, '45', 0, '注册成功赠送'),
(72, '0', 4308211020354, '2016-02-06 15:31:31', 20, '45', 0, '注册成功赠送'),
(73, '0', 4308211020355, '2016-02-13 11:03:33', 20, '45', 0, '注册成功赠送'),
(74, '0', 4308211020356, '2016-02-13 19:36:03', 20, '45', 0, '注册成功赠送'),
(75, '0', 4308211020357, '2016-02-20 22:38:36', 20, '45', 0, '注册成功赠送'),
(76, '0', 4308211020358, '2016-02-21 03:05:09', 20, '45', 0, '注册成功赠送'),
(77, '0', 4308211020359, '2016-02-23 11:33:32', 20, '45', 0, '注册成功赠送'),
(78, '0', 4308211020360, '2016-02-25 22:18:02', 20, '45', 0, '注册成功赠送'),
(79, '0', 4308211020361, '2016-03-04 16:48:00', 20, '45', 0, '注册成功赠送'),
(80, '0', 4308211020362, '2016-03-08 13:28:42', 20, '45', 0, '注册成功赠送'),
(81, '0', 4308211020363, '2016-03-10 14:25:27', 20, '45', 0, '注册成功赠送'),
(82, '0', 4308211020364, '2016-05-17 13:38:06', 20, '45', 0, '注册成功赠送'),
(83, '0', 4308211020365, '2016-06-10 14:05:36', 20, '45', 0, '注册成功赠送'),
(84, '0', 4308211020366, '2016-06-19 20:34:33', 20, '45', 0, '注册成功赠送'),
(85, '0', 4308211020367, '2016-06-22 16:36:44', 20, '45', 0, '注册成功赠送'),
(86, '0', 4308211020368, '2016-06-28 10:16:59', 20, '45', 0, '注册成功赠送'),
(87, '0', 4308211020369, '2016-07-09 22:26:42', 20, '45', 0, '注册成功赠送'),
(88, '0', 4308211020370, '2016-07-10 17:03:18', 20, '45', 0, '注册成功赠送'),
(89, '0', 4308211020371, '2016-07-25 01:43:42', 20, '45', 0, '注册成功赠送'),
(90, '0', 4308211020372, '2016-08-01 09:55:47', 20, '45', 0, '注册成功赠送'),
(91, '0', 4308211020373, '2016-08-10 00:41:34', 20, '45', 0, '注册成功赠送'),
(92, '0', 4308211020374, '2016-09-18 10:46:20', 20, '45', 0, '注册成功赠送'),
(93, '0', 4308211020375, '2016-09-18 22:13:52', 20, '45', 0, '注册成功赠送'),
(94, '0', 4308211020376, '2016-09-20 11:27:15', 20, '45', 0, '注册成功赠送');

--
-- 触发器 `zjr_shop_coin_trans`
--
DELIMITER $$
CREATE TRIGGER `update_shop_coin` AFTER INSERT ON `zjr_shop_coin_trans` FOR EACH ROW begin
 update zjr_coin_balance set ShopBal=ShopBal+new.TransAmt where UserId=new.UserId;
end
$$
DELIMITER ;
