coupon_act.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. $shop_id = Dever::input('search_option_shop_id');
  3. $coupon = function() use($shop_id)
  4. {
  5. $array = array();
  6. $info = Dever::load('shop/lib/coupon')->getData($shop_id);
  7. if($info)
  8. {
  9. $array += $info;
  10. }
  11. return $array;
  12. };
  13. return array
  14. (
  15. # 表名
  16. 'name' => 'coupon_act',
  17. # 显示给用户看的名称
  18. 'lang' => '活动优惠券设置',
  19. 'menu' => false,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'search' => 'order',
  31. 'update' => 'hidden',
  32. //'list' => true,
  33. ),
  34. 'shop_id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '所属门店',
  38. 'default' => '',
  39. 'desc' => '所属门店',
  40. 'match' => 'is_numeric',
  41. 'update' => 'hidden',
  42. 'value' => $shop_id,
  43. 'list' => 'Dever::load("shop/info-find#name", {shop_id})',
  44. ),
  45. 'act_id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '活动名称',
  49. 'default' => '',
  50. 'desc' => '活动名称',
  51. 'match' => 'is_numeric',
  52. 'update' => 'select',
  53. 'list' => 'Dever::load("act/info-find#name", {act_id})',
  54. ),
  55. 'shop_coupon_id' => array
  56. (
  57. 'type' => 'varchar-500',
  58. 'name' => '勾选参与活动可发放的优惠券',
  59. 'default' => '',
  60. 'desc' => '勾选参与活动可发放的优惠券',
  61. 'match' => 'option',
  62. 'update' => 'checkbox',
  63. 'option' => $coupon,
  64. 'list' => true,
  65. ),
  66. 'state' => array
  67. (
  68. 'type' => 'tinyint-1',
  69. 'name' => '状态',
  70. 'default' => '1',
  71. 'desc' => '请选择状态',
  72. 'match' => 'is_numeric',
  73. ),
  74. 'cdate' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '创建时间',
  78. 'match' => array('is_numeric', time()),
  79. 'desc' => '',
  80. # 只有insert时才生效
  81. //'insert' => true,
  82. 'search' => 'date',
  83. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  84. ),
  85. ),
  86. 'manage' => array
  87. (
  88. ),
  89. 'request' => array
  90. (
  91. 'getData' => array
  92. (
  93. # 匹配的正则或函数 选填项
  94. 'option' => array
  95. (
  96. 'shop_id' => 'yes',
  97. 'act_id' => 'yes',
  98. 'state' => 1,
  99. ),
  100. 'type' => 'all',
  101. 'order' => array('id' => 'desc'),
  102. 'col' => '*',
  103. ),
  104. 'getOne' => array
  105. (
  106. # 匹配的正则或函数 选填项
  107. 'option' => array
  108. (
  109. 'shop_id' => 'yes',
  110. 'act_id' => 'yes',
  111. 'state' => 1,
  112. ),
  113. 'type' => 'one',
  114. 'col' => '*',
  115. ),
  116. ),
  117. );