coupon_act_1.php 3.1 KB

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