member.ctrl.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. $dos = array('module', 'coupon', 'location', 'discount', 'display', 'del', 'sync', 'modifystock', 'toggle', 'qr', 'record', 'cash', 'gift', 'groupon', 'general_coupon');
  8. $do = in_array($do, $dos) ? $do : 'post';
  9. $op = trim($_GPC['op']) ? trim($_GPC['op']) : 'post';
  10. $acid = intval($_W['acid']);
  11. load()->classs('coupon');
  12. if($do == 'post') {
  13. $data = array(
  14. 'card' => array(
  15. 'card_type' => 'MEMBER_CARD',
  16. 'member_card' => array(
  17. 'base_info' => array(
  18. 'logo_url' => urlencode('http://mmbiz.qpic.cn/mmbiz/qYicJhgpqsd37NCqJIqia4KF9o4fmq7NTgnQMd5vBSwn2ibBRQ4wCLr47ohUI6xicWUc7ibxoyJDubnNs3mxnfSXy2g/0'),
  19. 'brand_name' => urlencode('商家信息'),
  20. 'color' => 'Color080',
  21. 'title' => urlencode('折扣券标题'),
  22. 'sub_title' => urlencode('折扣券标题'),
  23. 'can_share' => true,
  24. 'can_give_friend' => true,
  25. 'code_type' => 'CODE_TYPE_TEXT',
  26. 'notice' => urlencode('操作提示操作提示'),
  27. 'description' => urlencode('使用须知使用须知'),
  28. 'service_phone' => urlencode('1000000'),
  29. 'get_limit' => 100,
  30. 'date_info' => array(
  31. 'type' => 'DATE_TYPE_FIX_TIME_RANGE',
  32. 'begin_timestamp' => '1439136000',
  33. 'end_timestamp' => '1444838400'
  34. ),
  35. 'sku' => array(
  36. 'quantity' => 10000
  37. ),
  38. 'custom_url_name' => urlencode('立即使用'),
  39. 'custom_url' => urlencode('http://bbs.we7.cc'),
  40. 'custom_url_sub_title' => urlencode('6个汉字tips'),
  41. 'promotion_url_name' => urlencode('营销入口1'),
  42. 'promotion_url' => urlencode('http://www.we7.cc'),
  43. ),
  44. 'supply_bonus' => true,
  45. 'supply_balance' => false,
  46. 'prerogative' => urlencode('会员卡特权说明'),
  47. 'custom_field1' => array(
  48. 'name_type' => 'FIELD_NAME_TYPE_LEVEL',
  49. 'url' => urlencode('http://www.we7.cc'),
  50. ),
  51. 'activate_url' => urlencode('http://bbs.we7.cc'),
  52. 'custom_cell1' => array(
  53. 'name' => urlencode('使用入口2'),
  54. 'tips' => urlencode('激活后显示'),
  55. 'url' => urlencode('http://bbs.we7.cc'),
  56. )
  57. ),
  58. ),
  59. );
  60. $acc = new coupon($acid);
  61. $status = $acc->CreateCard(urldecode(json_encode(($data))));
  62. print_r($status);
  63. }
  64. if($do == 'update') {
  65. $data = array(
  66. 'init_bonus' => 100,
  67. 'init_balance' => 200,
  68. 'membership_number' => 12345678,
  69. 'code' => '',
  70. 'card_id' => 'pTKzFjtDm_SKwh2vbiLwD2cGO0Ik ',
  71. 'custom_field_value1' => '白金会员组',
  72. );
  73. }