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

--
-- 表的结构 `zjr_lucky_coin_trans`
--

CREATE TABLE `zjr_lucky_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_lucky_coin_trans`
--

INSERT INTO `zjr_lucky_coin_trans` (`TransId`, `OkFlag`, `UserId`, `TransTmk`, `TransAmt`, `TransCat`, `RefId`, `TransMemo`) VALUES
(1, '0', 4308211020301, '2015-12-01 19:09:52', 5, '43', 0, '邀请好友系统奖励'),
(2, '0', 4308211020301, '2015-12-01 19:09:55', 5, '43', 0, '邀请好友系统奖励'),
(3, '0', 4308211020302, '2015-12-01 19:13:00', 5, '43', 0, '邀请好友系统奖励'),
(4, '0', 4308211020302, '2015-12-01 19:13:04', 5, '43', 0, '邀请好友系统奖励'),
(5, '0', 4308211020302, '2015-12-01 19:13:07', 5, '43', 0, '邀请好友系统奖励'),
(6, '0', 4308211020302, '2015-12-01 19:13:10', 5, '43', 0, '邀请好友系统奖励'),
(7, '0', 4308211020302, '2015-12-01 19:37:01', 12, '46', 0, '摇钱树中奖'),
(8, '0', 4308211020302, '2015-12-02 14:59:58', 36, '46', 0, '摇钱树中奖'),
(9, '0', 4308211020302, '2015-12-02 15:11:33', 47, '46', 0, '摇钱树中奖'),
(10, '0', 4308211020302, '2015-12-02 15:12:07', -100, '38', 11, '赠送给蔡小严(蔡小严)'),
(11, '0', 4308211020305, '2015-12-02 15:12:07', 100, '38', 10, '由蔡太阳赠送'),
(12, '0', 4308211020302, '2015-12-02 16:32:02', -10, '38', 13, '赠送给杨春星'),
(13, '0', 4308211020306, '2015-12-02 16:32:02', 10, '38', 12, '由蔡胖赠送'),
(14, '0', 4308211020302, '2015-12-02 16:37:16', 67, '46', 0, '摇钱树中奖'),
(15, '0', 4308211020302, '2015-12-02 16:43:09', 35, '46', 0, '摇钱树中奖'),
(16, '0', 4308211020302, '2015-12-02 16:44:08', 5, '46', 0, '摇钱树中奖'),
(17, '0', 4308211020302, '2015-12-02 16:44:55', 88, '46', 0, '摇钱树中奖'),
(18, '0', 4308211020306, '2015-12-02 21:49:37', -10, '63', 11, '兑换购物币'),
(19, '0', 4308211020312, '2015-12-08 11:53:03', 1, '46', 0, '摇钱树中奖'),
(20, '0', 4308211020312, '2015-12-08 12:21:19', 81, '46', 0, '摇钱树中奖'),
(21, '0', 4308211020302, '2015-12-14 13:23:39', 88, '46', 0, '摇钱树中奖'),
(22, '0', 4308211020312, '2015-12-16 09:16:09', 19, '46', 0, '摇钱树中奖'),
(23, '0', 4308211020301, '2015-12-17 12:59:38', 67, '46', 0, '摇钱树中奖'),
(24, '0', 4308211020302, '2016-01-03 16:53:26', 16, '46', 0, '摇钱树中奖'),
(26, '0', 4308211020325, '2016-01-11 15:52:50', 5, '43', 0, '邀请好友系统奖励'),
(27, '0', 4308211020329, '2016-01-11 19:47:42', 22, '46', 0, '摇钱树中奖'),
(28, '0', 4308211020329, '2016-01-11 19:48:29', -20, '63', 36, '兑换购物币'),
(29, '0', 4308211020330, '2016-01-11 21:34:17', 5, '43', 0, '邀请好友系统奖励'),
(30, '0', 4308211020330, '2016-01-11 21:34:33', 5, '43', 0, '邀请好友系统奖励'),
(31, '0', 4308211020327, '2016-01-11 23:47:13', 5, '43', 0, '邀请好友系统奖励'),
(32, '0', 4308211020327, '2016-01-11 23:47:37', 5, '43', 0, '邀请好友系统奖励'),
(33, '0', 4308211020327, '2016-01-11 23:47:41', 5, '43', 0, '邀请好友系统奖励'),
(34, '0', 4308211020327, '2016-01-11 23:48:04', 5, '43', 0, '邀请好友系统奖励'),
(35, '0', 4308211020302, '2016-01-12 12:19:57', 6, '46', 0, '摇钱树中奖'),
(36, '0', 4308211020302, '2016-01-12 12:20:06', 6, '46', 0, '摇钱树中奖'),
(37, '0', 4308211020332, '2016-01-12 12:46:36', 97, '46', 0, '摇钱树中奖'),
(38, '0', 4308211020332, '2016-01-12 12:47:20', -90, '63', 42, '兑换购物币'),
(39, '0', 4308211020336, '2016-01-13 00:01:59', 2, '46', 0, '摇钱树中奖'),
(40, '0', 4308211020301, '2016-01-13 09:54:21', 78, '46', 0, '摇钱树中奖'),
(41, '0', 4308211020340, '2016-01-13 19:42:10', 85, '46', 0, '摇钱树中奖'),
(45, '0', 4308211020327, '2016-01-16 05:37:06', 5, '43', 0, '邀请好友系统奖励'),
(44, '0', 4308211020327, '2016-01-16 05:37:05', 5, '43', 0, '邀请好友系统奖励'),
(46, '0', 4308211020327, '2016-01-16 05:37:22', 5, '43', 0, '邀请好友系统奖励'),
(47, '0', 4308211020327, '2016-01-16 05:37:23', 5, '43', 0, '邀请好友系统奖励'),
(48, '0', 4308211020327, '2016-01-16 05:37:42', 5, '43', 0, '邀请好友系统奖励'),
(49, '0', 4308211020327, '2016-01-16 05:37:42', 5, '43', 0, '邀请好友系统奖励'),
(50, '0', 4308211020327, '2016-01-16 05:38:14', 5, '43', 0, '邀请好友系统奖励'),
(51, '0', 4308211020327, '2016-01-16 05:38:15', 5, '43', 0, '邀请好友系统奖励'),
(52, '0', 4308211020327, '2016-01-16 05:38:19', 5, '43', 0, '邀请好友系统奖励'),
(53, '0', 4308211020327, '2016-01-16 05:38:20', 5, '43', 0, '邀请好友系统奖励'),
(54, '0', 4308211020302, '2016-01-28 19:52:55', -310, '63', 65, '兑换购物币'),
(55, '0', 4308211020302, '2016-01-28 19:54:22', 63, '46', 0, '摇钱树中奖'),
(56, '0', 4308211020302, '2016-01-28 19:54:36', 72, '46', 0, '摇钱树中奖'),
(57, '0', 4308211020302, '2016-01-28 19:54:50', 2, '46', 0, '摇钱树中奖'),
(58, '0', 4308211020302, '2016-01-28 19:55:02', 33, '46', 0, '摇钱树中奖'),
(59, '0', 4308211020302, '2016-01-28 19:55:13', 52, '46', 0, '摇钱树中奖'),
(60, '0', 4308211020302, '2016-01-28 19:55:23', 17, '46', 0, '摇钱树中奖'),
(61, '0', 4308211020302, '2016-01-28 19:55:35', 56, '46', 0, '摇钱树中奖'),
(62, '0', 4308211020302, '2016-01-28 19:55:44', 22, '46', 0, '摇钱树中奖'),
(63, '0', 4308211020302, '2016-01-28 19:55:52', 56, '46', 0, '摇钱树中奖'),
(64, '0', 4308211020302, '2016-01-28 19:56:01', 40, '46', 0, '摇钱树中奖'),
(65, '0', 4308211020302, '2016-01-28 19:56:09', 64, '46', 0, '摇钱树中奖'),
(66, '0', 4308211020302, '2016-01-28 19:56:18', 28, '46', 0, '摇钱树中奖'),
(67, '0', 4308211020302, '2016-01-28 19:56:26', 68, '46', 0, '摇钱树中奖'),
(68, '0', 4308211020302, '2016-01-28 19:56:34', 34, '46', 0, '摇钱树中奖'),
(69, '0', 4308211020302, '2016-01-28 19:56:41', 71, '46', 0, '摇钱树中奖'),
(70, '0', 4308211020302, '2016-01-28 19:56:50', 28, '46', 0, '摇钱树中奖'),
(71, '0', 4308211020302, '2016-01-28 19:56:58', 56, '46', 0, '摇钱树中奖'),
(72, '0', 4308211020302, '2016-01-28 19:57:06', 68, '46', 0, '摇钱树中奖'),
(73, '0', 4308211020302, '2016-01-28 19:57:14', 12, '46', 0, '摇钱树中奖'),
(74, '0', 4308211020302, '2016-01-28 19:57:21', 15, '46', 0, '摇钱树中奖'),
(75, '0', 4308211020302, '2016-01-28 19:57:29', 59, '46', 0, '摇钱树中奖'),
(76, '0', 4308211020302, '2016-01-28 19:57:38', 98, '46', 0, '摇钱树中奖'),
(77, '0', 4308211020302, '2016-01-28 19:57:46', 59, '46', 0, '摇钱树中奖'),
(78, '0', 4308211020302, '2016-01-28 19:57:53', 25, '46', 0, '摇钱树中奖'),
(79, '0', 4308211020302, '2016-01-28 19:58:01', 100, '46', 0, '摇钱树中奖'),
(80, '0', 4308211020302, '2016-01-28 19:58:08', 93, '46', 0, '摇钱树中奖'),
(81, '0', 4308211020302, '2016-01-28 19:58:17', 28, '46', 0, '摇钱树中奖'),
(82, '0', 4308211020302, '2016-01-28 19:58:25', 24, '46', 0, '摇钱树中奖'),
(83, '0', 4308211020302, '2016-01-28 19:58:32', 32, '46', 0, '摇钱树中奖'),
(84, '0', 4308211020302, '2016-01-28 19:58:40', 23, '46', 0, '摇钱树中奖'),
(85, '0', 4308211020302, '2016-01-28 19:58:48', 36, '46', 0, '摇钱树中奖'),
(86, '0', 4308211020302, '2016-01-28 19:58:56', 52, '46', 0, '摇钱树中奖'),
(87, '0', 4308211020302, '2016-01-28 19:59:04', 51, '46', 0, '摇钱树中奖'),
(88, '0', 4308211020302, '2016-01-28 19:59:12', 14, '46', 0, '摇钱树中奖'),
(89, '0', 4308211020302, '2016-01-28 19:59:20', 11, '46', 0, '摇钱树中奖'),
(90, '0', 4308211020302, '2016-01-28 19:59:29', 71, '46', 0, '摇钱树中奖'),
(91, '0', 4308211020302, '2016-01-28 19:59:36', 18, '46', 0, '摇钱树中奖'),
(92, '0', 4308211020302, '2016-01-28 19:59:44', 23, '46', 0, '摇钱树中奖'),
(93, '0', 4308211020302, '2016-01-28 19:59:52', 7, '46', 0, '摇钱树中奖'),
(94, '0', 4308211020302, '2016-01-28 20:00:01', 26, '46', 0, '摇钱树中奖'),
(95, '0', 4308211020302, '2016-01-28 20:00:10', 55, '46', 0, '摇钱树中奖'),
(96, '0', 4308211020302, '2016-01-28 20:00:17', 35, '46', 0, '摇钱树中奖'),
(97, '0', 4308211020302, '2016-01-28 20:00:25', 36, '46', 0, '摇钱树中奖'),
(98, '0', 4308211020302, '2016-01-28 20:00:36', 77, '46', 0, '摇钱树中奖'),
(99, '0', 4308211020302, '2016-01-28 20:00:44', 11, '46', 0, '摇钱树中奖'),
(100, '0', 4308211020302, '2016-01-28 20:00:52', 13, '46', 0, '摇钱树中奖'),
(101, '0', 4308211020302, '2016-01-28 20:01:00', 53, '46', 0, '摇钱树中奖'),
(102, '0', 4308211020302, '2016-01-28 20:01:08', 81, '46', 0, '摇钱树中奖'),
(103, '0', 4308211020302, '2016-01-28 20:01:33', -2070, '63', 66, '兑换购物币'),
(104, '0', 4308211020352, '2016-02-01 18:48:45', 25, '46', 0, '摇钱树中奖'),
(105, '0', 4308211020302, '2016-02-01 18:48:45', -4, '38', 106, '赠送给蔡粤'),
(106, '0', 4308211020352, '2016-02-01 18:48:45', 4, '38', 105, '由蔡胖赠送'),
(107, '0', 4308211020352, '2016-02-01 18:49:11', 44, '46', 0, '摇钱树中奖'),
(108, '0', 4308211020352, '2016-02-01 18:49:35', 78, '46', 0, '摇钱树中奖'),
(109, '0', 4308211020352, '2016-02-01 18:49:45', 98, '46', 0, '摇钱树中奖'),
(110, '0', 4308211020352, '2016-02-01 18:50:34', 78, '46', 0, '摇钱树中奖'),
(111, '0', 4308211020352, '2016-02-01 18:52:22', 62, '46', 0, '摇钱树中奖'),
(112, '0', 4308211020352, '2016-02-01 18:52:32', 94, '46', 0, '摇钱树中奖'),
(113, '0', 4308211020352, '2016-02-01 18:52:41', 31, '46', 0, '摇钱树中奖'),
(114, '0', 4308211020352, '2016-02-01 18:52:48', 69, '46', 0, '摇钱树中奖'),
(115, '0', 4308211020352, '2016-02-01 18:52:56', 44, '46', 0, '摇钱树中奖'),
(116, '0', 4308211020352, '2016-02-01 18:53:04', 59, '46', 0, '摇钱树中奖'),
(117, '0', 4308211020352, '2016-02-01 18:53:12', 16, '46', 0, '摇钱树中奖'),
(118, '0', 4308211020352, '2016-02-01 18:53:21', 76, '46', 0, '摇钱树中奖'),
(119, '0', 4308211020352, '2016-02-01 18:53:29', 96, '46', 0, '摇钱树中奖'),
(120, '0', 4308211020352, '2016-02-01 18:53:36', 78, '46', 0, '摇钱树中奖'),
(121, '0', 4308211020352, '2016-02-01 18:53:47', 48, '46', 0, '摇钱树中奖'),
(122, '0', 4308211020352, '2016-02-01 18:53:54', 50, '46', 0, '摇钱树中奖'),
(123, '0', 4308211020352, '2016-02-01 18:54:02', 66, '46', 0, '摇钱树中奖'),
(124, '0', 4308211020352, '2016-02-01 18:54:11', 71, '46', 0, '摇钱树中奖'),
(125, '0', 4308211020352, '2016-02-01 18:54:21', 39, '46', 0, '摇钱树中奖'),
(126, '0', 4308211020352, '2016-02-01 18:54:31', 40, '46', 0, '摇钱树中奖'),
(127, '0', 4308211020352, '2016-02-01 18:54:39', 48, '46', 0, '摇钱树中奖'),
(128, '0', 4308211020352, '2016-02-01 18:54:51', 83, '46', 0, '摇钱树中奖'),
(129, '0', 4308211020352, '2016-02-01 18:55:00', 22, '46', 0, '摇钱树中奖'),
(130, '0', 4308211020352, '2016-02-01 18:55:07', 82, '46', 0, '摇钱树中奖'),
(131, '0', 4308211020352, '2016-02-01 18:55:14', 26, '46', 0, '摇钱树中奖'),
(132, '0', 4308211020352, '2016-02-01 18:55:23', 55, '46', 0, '摇钱树中奖'),
(133, '0', 4308211020352, '2016-02-01 18:55:30', 82, '46', 0, '摇钱树中奖'),
(134, '0', 4308211020352, '2016-02-01 18:55:38', 81, '46', 0, '摇钱树中奖'),
(135, '0', 4308211020352, '2016-02-01 18:55:49', 45, '46', 0, '摇钱树中奖'),
(136, '0', 4308211020352, '2016-02-01 18:55:58', 51, '46', 0, '摇钱树中奖'),
(137, '0', 4308211020352, '2016-02-01 18:56:10', 54, '46', 0, '摇钱树中奖'),
(138, '0', 4308211020352, '2016-02-01 18:56:18', 87, '46', 0, '摇钱树中奖'),
(139, '0', 4308211020352, '2016-02-01 18:56:28', 94, '46', 0, '摇钱树中奖'),
(140, '0', 4308211020352, '2016-02-01 18:56:36', 59, '46', 0, '摇钱树中奖'),
(141, '0', 4308211020352, '2016-02-01 18:56:43', 96, '46', 0, '摇钱树中奖'),
(142, '0', 4308211020352, '2016-02-01 18:56:50', 48, '46', 0, '摇钱树中奖'),
(143, '0', 4308211020352, '2016-02-01 18:56:57', 26, '46', 0, '摇钱树中奖'),
(144, '0', 4308211020352, '2016-02-01 18:57:05', 82, '46', 0, '摇钱树中奖'),
(145, '0', 4308211020352, '2016-02-01 18:57:14', 54, '46', 0, '摇钱树中奖'),
(146, '0', 4308211020352, '2016-02-01 18:57:34', 30, '46', 0, '摇钱树中奖'),
(147, '0', 4308211020352, '2016-02-01 18:57:41', 85, '46', 0, '摇钱树中奖'),
(148, '0', 4308211020352, '2016-02-01 18:57:52', 94, '46', 0, '摇钱树中奖'),
(149, '0', 4308211020352, '2016-02-01 18:57:59', 69, '46', 0, '摇钱树中奖'),
(150, '0', 4308211020352, '2016-02-01 18:58:06', 64, '46', 0, '摇钱树中奖'),
(151, '0', 4308211020352, '2016-02-01 18:58:48', -780, '63', 69, '兑换购物币'),
(152, '0', 4308211020352, '2016-02-01 18:59:13', -1000, '63', 70, '兑换购物币'),
(153, '0', 4308211020352, '2016-02-01 18:59:31', -1000, '63', 72, '兑换游戏币'),
(154, '0', 4308211020302, '2016-02-01 19:05:14', 7, '46', 0, '摇钱树中奖'),
(155, '0', 4308211020344, '2016-02-09 07:15:27', 11, '46', 0, '摇钱树中奖'),
(156, '0', 4308211020363, '2016-03-10 15:04:24', 0, '43', 0, '邀请好友系统奖励');

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