coupon_act.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. 'search' => 'hidden',
  43. 'value' => $shop_id,
  44. 'list' => 'Dever::load("shop/info-find#name", {shop_id})',
  45. ),
  46. 'act_id' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => '活动名称',
  50. 'default' => '',
  51. 'desc' => '活动名称',
  52. 'match' => 'is_numeric',
  53. 'update' => 'select',
  54. 'list' => 'Dever::load("act/info-find#name", {act_id})',
  55. ),
  56. 'shop_coupon_id' => array
  57. (
  58. 'type' => 'varchar-500',
  59. 'name' => '勾选参与活动可发放的优惠券',
  60. 'default' => '',
  61. 'desc' => '勾选参与活动可发放的优惠券',
  62. 'match' => 'option',
  63. 'update' => 'checkbox',
  64. 'option' => $coupon,
  65. 'list' => true,
  66. ),
  67. 'state' => array
  68. (
  69. 'type' => 'tinyint-1',
  70. 'name' => '状态',
  71. 'default' => '1',
  72. 'desc' => '请选择状态',
  73. 'match' => 'is_numeric',
  74. ),
  75. 'cdate' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '创建时间',
  79. 'match' => array('is_numeric', time()),
  80. 'desc' => '',
  81. # 只有insert时才生效
  82. //'insert' => true,
  83. 'search' => 'date',
  84. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  85. ),
  86. ),
  87. 'manage' => array
  88. (
  89. ),
  90. 'request' => array
  91. (
  92. 'getData' => array
  93. (
  94. # 匹配的正则或函数 选填项
  95. 'option' => array
  96. (
  97. 'shop_id' => 'yes',
  98. 'act_id' => 'yes',
  99. 'state' => 1,
  100. ),
  101. 'type' => 'all',
  102. 'order' => array('id' => 'desc'),
  103. 'col' => '*',
  104. ),
  105. 'getOne' => array
  106. (
  107. # 匹配的正则或函数 选填项
  108. 'option' => array
  109. (
  110. 'shop_id' => 'yes',
  111. 'act_id' => 'yes',
  112. 'state' => 1,
  113. ),
  114. 'type' => 'one',
  115. 'col' => '*',
  116. ),
  117. ),
  118. );