user_coupon.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?php
  2. $status = array
  3. (
  4. 1 => '可用',
  5. 2 => '已使用',
  6. 3 => '已过期',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'user_coupon',
  12. # 显示给用户看的名称
  13. 'lang' => '用户优惠券',
  14. 'menu' => false,
  15. # 数据结构
  16. 'struct' => array
  17. (
  18. 'id' => array
  19. (
  20. 'type' => 'int-11',
  21. 'name' => 'ID',
  22. 'default' => '',
  23. 'desc' => '',
  24. 'match' => 'is_numeric',
  25. 'search' => 'order',
  26. 'update' => 'hidden',
  27. //'list' => true,
  28. ),
  29. 'uid' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => '用户名',
  33. 'default' => '0',
  34. 'desc' => '请选择用户',
  35. 'match' => 'is_numeric',
  36. 'update' => 'text',
  37. //'search' => 'select',
  38. 'search' => array
  39. (
  40. 'api' => 'passport/user-all',
  41. 'col' => 'username',
  42. 'result' => 'id',
  43. ),
  44. 'list' => '{uid} > 0 ? Dever::load("passport/user-find#username", {uid}) : "匿名用户"',
  45. ),
  46. 'shop_id' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => '所属门店',
  50. 'default' => '',
  51. 'desc' => '所属门店',
  52. 'match' => 'is_numeric',
  53. 'list' => 'Dever::load("shop/info-find#name", {shop_id})',
  54. ),
  55. 'coupon_id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '优惠券id',
  59. 'default' => '',
  60. 'desc' => '优惠券id',
  61. 'match' => 'is_numeric',
  62. 'list' => 'Dever::load("goods/coupon-find#name", {coupon_id})',
  63. ),
  64. 'shop_coupon_id' => array
  65. (
  66. 'type' => 'int-11',
  67. 'name' => '优惠券id',
  68. 'default' => '',
  69. 'desc' => '优惠券id',
  70. 'match' => 'is_numeric',
  71. ),
  72. 'city' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '城市',
  76. 'default' => '',
  77. 'desc' => '城市',
  78. 'match' => 'option',
  79. //'update' => 'text',
  80. ),
  81. 'cash' => array
  82. (
  83. 'type' => 'varchar-100',
  84. 'name' => '抵扣金额',
  85. 'default' => '0',
  86. 'desc' => '请输入抵扣金额',
  87. 'match' => 'is_string',
  88. 'update' => 'text',
  89. 'search' => 'fulltext',
  90. //'list' => true,
  91. ),
  92. 'status' => array
  93. (
  94. 'type' => 'int-11',
  95. 'name' => '可用状态',
  96. 'default' => '1',
  97. 'desc' => '可用状态',
  98. 'match' => 'is_numeric',
  99. //'update' => 'select',
  100. 'option' => $status,
  101. 'search' => 'select',
  102. 'list' => true,
  103. 'edit' => true,
  104. ),
  105. 'edate' => array
  106. (
  107. 'type' => 'int-11',
  108. 'name' => '失效时间',
  109. 'match' => 'is_numeric',
  110. 'desc' => '',
  111. 'list' => 'date("Y-m-d H:i:s", {edate})',
  112. ),
  113. 'state' => array
  114. (
  115. 'type' => 'tinyint-1',
  116. 'name' => '状态',
  117. 'default' => '1',
  118. 'desc' => '请选择状态',
  119. 'match' => 'is_numeric',
  120. ),
  121. 'cdate' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '领取时间',
  125. 'match' => array('is_numeric', time()),
  126. 'desc' => '',
  127. # 只有insert时才生效
  128. //'insert' => true,
  129. 'search' => 'date',
  130. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  131. ),
  132. ),
  133. 'manage' => array
  134. (
  135. ),
  136. 'request' => array
  137. (
  138. 'getOne' => array
  139. (
  140. # 匹配的正则或函数 选填项
  141. 'option' => array
  142. (
  143. 'uid' => 'yes',
  144. 'shop_coupon_id' => 'yes',
  145. 'coupon_id' => 'yes',
  146. 'state' => 1,
  147. ),
  148. 'type' => 'one',
  149. 'order' => array('cdate' => 'desc', 'id' => 'desc'),
  150. 'col' => '*',
  151. ),
  152. # 列表
  153. 'getAll' => array
  154. (
  155. # 匹配的正则或函数 选填项
  156. 'option' => array
  157. (
  158. 'uid' => 'yes',
  159. 'city' => 'yes',
  160. 'edate' => array('yes', '>='),
  161. 'status' => 1,
  162. 'state' => 1,
  163. ),
  164. 'type' => 'all',
  165. 'order' => array('status' => 'asc','edate' => 'asc','cash' => 'desc', 'id' => 'desc'),
  166. 'col' => '*',
  167. ),
  168. # 列表
  169. 'getAllPage' => array
  170. (
  171. # 匹配的正则或函数 选填项
  172. 'option' => array
  173. (
  174. 'uid' => 'yes',
  175. 'city' => 'yes',
  176. 'edate' => array('yes', '>='),
  177. //'status' => 1,
  178. 'state' => 1,
  179. ),
  180. 'type' => 'all',
  181. 'page' => array(10, 'list'),
  182. 'order' => array('status' => 'asc','edate' => 'asc','cash' => 'desc', 'id' => 'desc'),
  183. 'col' => '*',
  184. ),
  185. ),
  186. );