-
Notifications
You must be signed in to change notification settings - Fork 7
/
upgrade.php
412 lines (396 loc) · 17.6 KB
/
upgrade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
<?php
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_dispatch` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT '0',
`dispatchname` varchar(50) DEFAULT '',
`dispatchtype` int(11) DEFAULT '0',
`displayorder` int(11) DEFAULT '0',
`firstprice` decimal(10,2) DEFAULT '0.00',
`secondprice` decimal(10,2) DEFAULT '0.00',
`firstweight` int(11) DEFAULT '0',
`secondweight` int(11) DEFAULT '0',
`express` varchar(250) DEFAULT '',
`areas` text,
`carriers` text,
`enabled` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_uniacid` (`uniacid`),
KEY `idx_displayorder` (`displayorder`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_member` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`uniacid` int(10) unsigned NOT NULL COMMENT '公众账号id',
`openid` varchar(100) NOT NULL COMMENT '微信会员openID',
`nickname` varchar(50) NOT NULL COMMENT '昵称',
`avatar` varchar(255) NOT NULL COMMENT '头像',
`tag` varchar(1000) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_arealimit` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) NOT NULL,
`enabled` int(11) NOT NULL,
`arealimitname` varchar(56) NOT NULL,
`areas` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_saler` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`storeid` varchar(225) DEFAULT '',
`uniacid` int(11) DEFAULT '0',
`openid` varchar(255) DEFAULT '',
`nickname` varchar(145) NOT NULL,
`avatar` varchar(225) NOT NULL,
`status` tinyint(3) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_storeid` (`storeid`),
KEY `idx_uniacid` (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_store` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT '0',
`storename` varchar(255) DEFAULT '',
`address` varchar(255) DEFAULT '',
`tel` varchar(255) DEFAULT '',
`lat` varchar(255) DEFAULT '',
`lng` varchar(255) DEFAULT '',
`status` tinyint(3) DEFAULT '0',
`createtime` varchar(45) NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_uniacid` (`uniacid`),
KEY `idx_status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_arealimit` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) NOT NULL,
`enabled` int(11) NOT NULL,
`arealimitname` varchar(56) NOT NULL,
`areas` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_dispatch` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT '0',
`dispatchname` varchar(50) DEFAULT '',
`dispatchtype` int(11) DEFAULT '0',
`displayorder` int(11) DEFAULT '0',
`firstprice` decimal(10,2) DEFAULT '0.00',
`secondprice` decimal(10,2) DEFAULT '0.00',
`firstweight` int(11) DEFAULT '0',
`secondweight` int(11) DEFAULT '0',
`express` varchar(250) DEFAULT '',
`areas` text,
`carriers` text,
`enabled` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_uniacid` (`uniacid`),
KEY `idx_displayorder` (`displayorder`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_goods_option` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`goodsid` int(10) DEFAULT '0',
`title` varchar(50) DEFAULT '',
`thumb` varchar(60) DEFAULT '',
`productprice` decimal(10,2) DEFAULT '0.00',
`marketprice` decimal(10,2) DEFAULT '0.00',
`costprice` decimal(10,2) DEFAULT '0.00',
`stock` int(11) DEFAULT '0',
`weight` decimal(10,2) DEFAULT '0.00',
`displayorder` int(11) DEFAULT '0',
`specs` text,
PRIMARY KEY (`id`),
KEY `indx_goodsid` (`goodsid`),
KEY `indx_displayorder` (`displayorder`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`groupnumber` varchar(115) NOT NULL COMMENT '团编号',
`goodsid` int(11) NOT NULL COMMENT '商品ID',
`goodsname` varchar(1024) NOT NULL COMMENT '商品名称',
`groupstatus` int(11) NOT NULL COMMENT '团状态',
`neednum` int(11) NOT NULL COMMENT '所需人数',
`lacknum` int(11) NOT NULL COMMENT '缺少人数',
`starttime` varchar(225) NOT NULL COMMENT '开团时间',
`endtime` varchar(225) NOT NULL COMMENT '到期时间',
`uniacid` int(11) NOT NULL,
`grouptype` int(11) NOT NULL COMMENT '1同2异3普通4单',
`isshare` int(11) NOT NULL COMMENT '1分享2不分享',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_saler` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`storeid` varchar(225) DEFAULT '',
`uniacid` int(11) DEFAULT '0',
`openid` varchar(255) DEFAULT '',
`nickname` varchar(145) NOT NULL,
`avatar` varchar(225) NOT NULL,
`status` tinyint(3) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_storeid` (`storeid`),
KEY `idx_uniacid` (`uniacid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_spec` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`weid` int(10) unsigned NOT NULL,
`title` varchar(50) NOT NULL,
`description` varchar(1000) NOT NULL,
`displaytype` tinyint(3) unsigned NOT NULL,
`content` text NOT NULL,
`goodsid` int(11) DEFAULT '0',
`displayorder` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_spec_item` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`weid` int(11) DEFAULT '0',
`specid` int(11) DEFAULT '0',
`title` varchar(255) DEFAULT '',
`thumb` varchar(255) DEFAULT '',
`show` int(11) DEFAULT '0',
`displayorder` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `indx_weid` (`weid`),
KEY `indx_specid` (`specid`),
KEY `indx_show` (`show`),
KEY `indx_displayorder` (`displayorder`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_store` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT '0',
`storename` varchar(255) DEFAULT '',
`address` varchar(255) DEFAULT '',
`tel` varchar(255) DEFAULT '',
`lat` varchar(255) DEFAULT '',
`lng` varchar(255) DEFAULT '',
`status` tinyint(3) DEFAULT '0',
`createtime` varchar(45) NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_uniacid` (`uniacid`),
KEY `idx_status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`title` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
pdo_query("CREATE TABLE IF NOT EXISTS `ims_tg_merchant` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(145) NOT NULL,
`logo` varchar(225) NOT NULL,
`industry` varchar(45) NOT NULL,
`address` varchar(115) NOT NULL,
`linkman_name` varchar(145) NOT NULL,
`linkman_mobile` varchar(145) NOT NULL,
`uniacid` int(11) NOT NULL,
`createtime` varchar(115) NOT NULL,
`thumb` varchar(255) NOT NULL,
`detail` varchar(1222) NOT NULL,
`salenum` int(11) NOT NULL COMMENT '商家销量',
`open` int(11) NOT NULL COMMENT '是否分配商家权限',
`uname` varchar(45) NOT NULL,
`password` varchar(145) NOT NULL,
`uid` int(11) NOT NULL COMMENT '用户id',
`messageopenid` varchar(150) NOT NULL,
`openid` varchar(150) NOT NULL,
`goodsnum` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_tg_merchant_account` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`merchantid` int(11) NOT NULL COMMENT '商家ID',
`uniacid` int(11) NOT NULL,
`uid` int(11) NOT NULL COMMENT '操作员id',
`amount` decimal(10,2) NOT NULL COMMENT '交易总金额',
`updatetime` varchar(45) NOT NULL COMMENT '上次结算时间',
`no_money` decimal(10,2) NOT NULL COMMENT '目前未结算金额',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_tg_merchant_record` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`merchantid` int(11) NOT NULL COMMENT '商家id',
`money` varchar(45) NOT NULL COMMENT '本次结算金额',
`uid` int(11) NOT NULL COMMENT '操作员id',
`createtime` varchar(45) NOT NULL COMMENT '结算时间',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
if(!pdo_fieldexists('tg_order', 'goodsprice')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `goodsprice` VARCHAR( 45 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'pay_price')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `pay_price` VARCHAR( 45 ) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'freight')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `freight` VARCHAR( 45 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'yunfei_id')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `yunfei_id` int( 11 ) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'is_discount')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `is_discount` int( 11 ) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'credits')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `credits` int( 11 ) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'credits')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `credits` int( 11 ) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'is_usecard')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `is_usecard` int( 11 ) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'is_hexiao')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `is_hexiao` int( 2 ) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'hexiao_id')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `hexiao_id` VARCHAR( 225 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'is_hexiao')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `is_hexiao` int( 2 ) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'hexiaoma')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `hexiaoma` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'veropenid')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `veropenid` VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'is_share')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `is_share` int(2) NOT NULL;");
}
if(!pdo_fieldexists('tg_address', 'type')) {
pdo_query("ALTER TABLE ".tablename('tg_address')." ADD `type` int(2) NOT NULL COMMENT '1公司,2家庭';");
}
if(!pdo_fieldexists('tg_goods', 'gdetaile')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `gdetaile` longtext NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'isnew')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `isnew` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'isrecommand')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `isrecommand` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'isdiscount')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `isdiscount` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'hasoption')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `hasoption` int(11) NOT NULL;");
}
if(pdo_fieldexists('tg_member', 'from_user')) {
pdo_query("ALTER TABLE ".tablename('tg_member')." CHANGE `from_user` `openid` varchar(100) NOT NULL COMMENT '微信会员openID';");
}
if(!pdo_fieldexists('tg_member', 'tag')) {
pdo_query("ALTER TABLE ".tablename('tg_member')." ADD `tag` varchar(1000) NOT NULL;");
}
if(!pdo_fieldexists('tg_member', 'mobile')) {
pdo_query("ALTER TABLE ".tablename('tg_member')." ADD `mobile` varchar(20) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'sendtime')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `sendtime` varchar(115) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'gettime')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `gettime` varchar(115) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'addresstype')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `addresstype` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'optionid')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `optionid` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'checkpay')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `checkpay` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_refund_record', 'type')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `type` int(11) NOT NULL COMMENT '1手机端2Web端3最后一人退款4部分退款';");
}
if(!pdo_fieldexists('tg_refund_record', 'goodsid')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `goodsid` int(11) NOT NULL COMMENT '商品ID';");
}
if(!pdo_fieldexists('tg_refund_record', 'payfee')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `payfee` varchar(100) NOT NULL COMMENT '支付金额';");
}
if(!pdo_fieldexists('tg_refund_record', 'refundfee')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `refundfee` varchar(100) NOT NULL COMMENT '退还金额';");
}
if(pdo_fieldexists('tg_refund_record', 'transid')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." CHANGE `transid` `transid` varchar(115) NOT NULL COMMENT '订单编号';");
}
if(!pdo_fieldexists('tg_refund_record', 'refund_id')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `refund_id` varchar(115) NOT NULL COMMENT '微信退款单号';");
}
if(!pdo_fieldexists('tg_refund_record', 'refundername')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `refundername` varchar(100) NOT NULL COMMENT '退款人姓名';");
}
if(!pdo_fieldexists('tg_refund_record', 'refundermobile')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `refundermobile` varchar(100) NOT NULL COMMENT '退款人电话';");
}
if(!pdo_fieldexists('tg_refund_record', 'goodsname')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `goodsname` varchar(100) NOT NULL COMMENT '商品名称';");
}
if(pdo_fieldexists('tg_refund_record', 'createtime')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." CHANGE `createtime` `createtime` varchar(45) NOT NULL COMMENT '退款时间';");
}
if(!pdo_fieldexists('tg_refund_record', 'status')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `status` int(11) NOT NULL COMMENT '0未成功1成功';");
}
if(!pdo_fieldexists('tg_refund_record', 'uniacid')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `uniacid` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_refund_record', 'orderid')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `orderid` varchar(45) NOT NULL;");
}
if(pdo_fieldexists('tg_address', 'type')) {
pdo_query("ALTER TABLE ".tablename('tg_address')." CHANGE `type` `type` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_dispatch', 'merchantid')) {
pdo_query("ALTER TABLE ".tablename('tg_dispatch')." ADD `merchantid` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'group_level')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `group_level` varchar(1000) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'group_level_status')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `group_level_status` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'merchantid')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `merchantid` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'share_title')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `share_title` varchar(200) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'share_image')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `share_image` varchar(250) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'share_desc')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `share_desc` varchar(200) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'one_limit')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `one_limit` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'many_limit')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `many_limit` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_goods', 'firstdiscount')) {
pdo_query("ALTER TABLE ".tablename('tg_goods')." ADD `firstdiscount` decimal(10,2) NOT NULL;");
}
if(!pdo_fieldexists('tg_group', 'price')) {
pdo_query("ALTER TABLE ".tablename('tg_group')." ADD `price` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'merchantid')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `merchantid` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_order', 'optionname')) {
pdo_query("ALTER TABLE ".tablename('tg_order')." ADD `optionname` varchar(100) NOT NULL;");
}
if(!pdo_fieldexists('tg_refund_record', 'merchantid')) {
pdo_query("ALTER TABLE ".tablename('tg_refund_record')." ADD `merchantid` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_saler', 'merchantid')) {
pdo_query("ALTER TABLE ".tablename('tg_saler')." ADD `merchantid` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_spec', 'merchantid')) {
pdo_query("ALTER TABLE ".tablename('tg_spec')." ADD `merchantid` int(11) NOT NULL;");
}
if(!pdo_fieldexists('tg_store', 'merchantid')) {
pdo_query("ALTER TABLE ".tablename('tg_store')." ADD `merchantid` int(11) NOT NULL;");
}
?>