coupon.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?php
  2. $status = Dever::config('base')->status;
  3. $type = array
  4. (
  5. 1 => '满减券',
  6. //2 => '通用券',
  7. );
  8. $method = array
  9. (
  10. 1 => '通用券',
  11. 2 => '同城券',
  12. 3 => '门店券',
  13. );
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'coupon',
  18. # 显示给用户看的名称
  19. 'lang' => '优惠券配置',
  20. 'method' => $method,
  21. # 后台菜单排序
  22. 'order' => 100,
  23. # 数据结构
  24. 'struct' => array
  25. (
  26. 'id' => array
  27. (
  28. 'type' => 'int-11',
  29. 'name' => 'ID',
  30. 'default' => '',
  31. 'desc' => '',
  32. 'match' => 'is_numeric',
  33. 'search' => 'order',
  34. 'list' => true,
  35. 'order' => 'desc',
  36. ),
  37. 'name' => array
  38. (
  39. 'type' => 'varchar-80',
  40. 'name' => '优惠券名称',
  41. 'default' => '',
  42. 'desc' => '请输入优惠券名称',
  43. 'match' => 'is_string',
  44. 'update' => 'text',
  45. 'search' => 'fulltext',
  46. 'list' => true,
  47. ),
  48. 'type' => array
  49. (
  50. 'type' => 'int-11',
  51. 'name' => '优惠券类型',
  52. 'default' => '1',
  53. 'desc' => '优惠券类型',
  54. 'match' => 'is_numeric',
  55. 'update' => 'radio',
  56. 'option' => $type,
  57. 'search' => 'select',
  58. 'list' => true,
  59. 'control' => 'type',
  60. ),
  61. 'method' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => '优惠券属性',
  65. 'default' => '1',
  66. 'desc' => '优惠券属性',
  67. 'match' => 'is_numeric',
  68. 'search' => 'select',
  69. 'update' => 'radio',
  70. 'option' => $method,
  71. 'list' => true,
  72. ),
  73. 'total_cash' => array
  74. (
  75. 'type' => 'varchar-100',
  76. 'name' => '满减金额-如满100减50,这里填写100',
  77. 'default' => '',
  78. 'desc' => '请输入满减金额',
  79. 'match' => 'is_string',
  80. 'update' => 'text',
  81. //'search' => 'fulltext',
  82. //'list' => true,
  83. 'show' => 'type=1',
  84. ),
  85. 'cash' => array
  86. (
  87. 'type' => 'varchar-100',
  88. 'name' => '抵扣金额',
  89. 'default' => '',
  90. 'desc' => '请输入抵扣金额',
  91. 'match' => 'is_string',
  92. 'update' => 'text',
  93. 'search' => 'fulltext',
  94. //'list' => true,
  95. ),
  96. 'status' => array
  97. (
  98. 'type' => 'int-11',
  99. 'name' => '状态',
  100. 'default' => '1',
  101. 'desc' => '状态',
  102. 'match' => 'is_numeric',
  103. //'update' => 'select',
  104. 'option' => $status,
  105. 'search' => 'select',
  106. 'list' => true,
  107. 'edit' => true,
  108. ),
  109. 'content' => array
  110. (
  111. 'type' => 'text-800',
  112. 'name' => '使用规则',
  113. 'default' => '',
  114. 'desc' => '使用规则',
  115. 'match' => 'is_string',
  116. 'update' => 'editor',
  117. 'key' => '1',
  118. ),
  119. 'state' => array
  120. (
  121. 'type' => 'tinyint-1',
  122. 'name' => '状态',
  123. 'default' => '1',
  124. 'desc' => '请选择状态',
  125. 'match' => 'is_numeric',
  126. ),
  127. 'cdate' => array
  128. (
  129. 'type' => 'int-11',
  130. 'name' => '录入时间',
  131. 'match' => array('is_numeric', time()),
  132. 'desc' => '',
  133. # 只有insert时才生效
  134. 'insert' => true,
  135. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  136. ),
  137. ),
  138. 'manage' => array
  139. (
  140. ),
  141. 'request' => array
  142. (
  143. 'getAll' => array
  144. (
  145. # 匹配的正则或函数 选填项
  146. 'option' => array
  147. (
  148. 'method' => 'yes',
  149. 'state' => 1,
  150. ),
  151. 'type' => 'all',
  152. 'order' => array('cash' => 'desc', 'id' => 'asc'),
  153. 'col' => '*,id as value',
  154. ),
  155. ),
  156. );