url(r'^admin/member/activity/create$', admin_views.member_activity_create, name='member_activity_create'),
url(r'^admin/member/activity/share/list$', admin_views.member_activity_share_list, name='member_activity_share_list'),
+ url(r'^admin/coupon/list$', admin_views.coupon_list, name='coupon_list'),
+ url(r'^admin/coupon/details$', admin_views.coupon_details, name='coupon_details'),
+ url(r'^admin/coupon/create$', admin_views.coupon_create, name='coupon_create'),
+ url(r'^admin/coupon/update$', admin_views.coupon_update, name='coupon_update'),
+ url(r'^admin/coupon/delete$', admin_views.coupon_delete, name='coupon_delete'),
]
urlpatterns += [
@@ -56,6 +56,36 @@ class CouponInfo(BaseModelMixin): |
||
| 56 | 56 |
if self.coupon_expire_type == CouponInfo.FIXED_EXPIRED_TIME: |
| 57 | 57 |
return self.coupon_expire_at |
| 58 | 58 |
return tc.utc_datetime(days=self.coupon_valid_period) |
| 59 |
+ |
|
| 60 |
+ @property |
|
| 61 |
+ def admindata(self): |
|
| 62 |
+ return {
|
|
| 63 |
+ 'coupon_id': self.coupon_id, |
|
| 64 |
+ 'coupon_title': self.coupon_title, |
|
| 65 |
+ 'coupon_value': self.coupon_value, |
|
| 66 |
+ 'coupon_image': self.coupon_image_url, |
|
| 67 |
+ 'coupon_path': self.coupon_image_path, |
|
| 68 |
+ 'coupon_expire_type': self.coupon_expire_type, |
|
| 69 |
+ 'coupon_valid_period': self.coupon_valid_period, |
|
| 70 |
+ 'coupon_expire_at': tc.local_string(utc_dt=self.coupon_expire_at, format='%Y-%m-%d'), |
|
| 71 |
+ 'is_coupon_admin_writeoff': self.is_coupon_admin_writeoff, |
|
| 72 |
+ 'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M:%S'), |
|
| 73 |
+ } |
|
| 74 |
+ |
|
| 75 |
+ @property |
|
| 76 |
+ def admindetails(self): |
|
| 77 |
+ return {
|
|
| 78 |
+ 'coupon_id': self.coupon_id, |
|
| 79 |
+ 'coupon_title': self.coupon_title, |
|
| 80 |
+ 'coupon_value': self.coupon_value, |
|
| 81 |
+ 'coupon_detail': self.coupon_detail, |
|
| 82 |
+ 'coupon_image': self.coupon_image_url, |
|
| 83 |
+ 'coupon_path': self.coupon_image_path, |
|
| 84 |
+ 'coupon_expire_type': self.coupon_expire_type, |
|
| 85 |
+ 'coupon_valid_period': self.coupon_valid_period, |
|
| 86 |
+ 'coupon_expire_at': tc.local_string(utc_dt=self.coupon_expire_at, format='%Y-%m-%d'), |
|
| 87 |
+ 'is_coupon_admin_writeoff': self.is_coupon_admin_writeoff |
|
| 88 |
+ } |
|
| 59 | 89 |
|
| 60 | 90 |
|
| 61 | 91 |
class UserCouponInfo(BaseModelMixin): |