|
@@ -64,27 +64,38 @@ class product_path(Load):
|
|
|
,width = '600'
|
|
|
,height = '600'
|
|
|
,search = (('label-1','cdate-time-start','cdate-time-end','site_id-select-','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'选择站点',u'商品名'))
|
|
|
- ,thead = (u'所属站点', u'商品名', u'商品链接', u'更新时间')
|
|
|
- ,tbody = ('site', 'name', 'link', 'cdate')
|
|
|
+ ,thead = (u'所属站点', u'商品名', u'状态', u'更新时间')
|
|
|
+ ,tbody = ('site', 'name', 'status', 'cdate')
|
|
|
,state = True
|
|
|
)
|
|
|
self.data['common']['search_site_id-select-'] = self.service('common').list('site')
|
|
|
self.commonList('product')
|
|
|
+ status = {}
|
|
|
+ status[1] = '待机'
|
|
|
+ status[2] = '入队'
|
|
|
+ status[3] = '抢购中'
|
|
|
+ status[4] = '抢购完成'
|
|
|
if self.data['list']:
|
|
|
for key, value in enumerate(self.data['list']):
|
|
|
site = self.service('common').one('site', id=value['site_id'])
|
|
|
self.data['list'][key]['site'] = site['name']
|
|
|
+ self.data['list'][key]['status'] = '<a href="/site/order?search_product_id-select-='+str(value['id'])+'">'+status[value['status']]+'[查看二维码]</a>'
|
|
|
+
|
|
|
self.commonView('list')
|
|
|
|
|
|
class product_update_path(Load):
|
|
|
@Web.auth
|
|
|
@Web.setting
|
|
|
def get(self):
|
|
|
+ status = [
|
|
|
+ {'id':'1', 'name': '待机-如果之前抢购完成,选择此项可以重新开始抢购'},
|
|
|
+ ]
|
|
|
self.common(
|
|
|
path = '/site/product'
|
|
|
- ,label = (u'所属站点', u'商品名称', u'商品链接')
|
|
|
- ,update = ('site_id-select-required', 'name-input-required','link-input-required')
|
|
|
+ ,label = (u'所属站点', u'商品名称', u'商品链接', u'状态控制')
|
|
|
+ ,update = ('site_id-select-required', 'name-input-required','link-input-required', 'status-select-required')
|
|
|
,update_site_id = self.service('common').list('site')
|
|
|
+ ,update_status = status
|
|
|
)
|
|
|
self.commonOne('product')
|
|
|
self.commonView('update')
|
|
@@ -95,4 +106,31 @@ class product_update_path(Load):
|
|
|
@Web.auth
|
|
|
@Web.setting
|
|
|
def delete(self):
|
|
|
- self.commonDelete('product')
|
|
|
+ self.commonDelete('product')
|
|
|
+
|
|
|
+class order_path(Load):
|
|
|
+ @Web.auth
|
|
|
+ @Web.setting
|
|
|
+ def get(self):
|
|
|
+ self.common(
|
|
|
+ name = u'商品订单列表'
|
|
|
+ ,path = '/site/order'
|
|
|
+ ,width = '600'
|
|
|
+ ,height = '600'
|
|
|
+ ,edit = False
|
|
|
+ ,add = False
|
|
|
+ ,search = (('label-1','cdate-time-start','cdate-time-end', 'orderID-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'订单ID'))
|
|
|
+ ,thead = (u'商品名称', u'订单ID', u'二维码', u'更新时间')
|
|
|
+ ,tbody = ('name', 'orderID', 'pic', 'cdate')
|
|
|
+ ,state = False
|
|
|
+ )
|
|
|
+
|
|
|
+ self.commonList('order')
|
|
|
+ if self.data['list']:
|
|
|
+ for key, value in enumerate(self.data['list']):
|
|
|
+ product = self.service('common').one('product', id=value['product_id'])
|
|
|
+ self.data['list'][key]['name'] = product['name']
|
|
|
+ value['pic'] = value['pic'].replace(Demeter.path + 'runtime', '')
|
|
|
+ self.data['list'][key]['pic'] = '<img src="'+value['pic']+'" width="200px" />'
|
|
|
+
|
|
|
+ self.commonView('list')
|