code.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <?php
  2. $status = array
  3. (
  4. 1 => '待核销',
  5. 2 => '已核销',
  6. 3 => '已作废',
  7. );
  8. $act_status = array
  9. (
  10. 1 => '未开始',
  11. 2 => '报名中',
  12. 3 => '报名结束',
  13. 4 => '活动开始',
  14. 5 => '活动结束',
  15. );
  16. return array
  17. (
  18. # 表名
  19. 'name' => 'code',
  20. # 显示给用户看的名称
  21. 'lang' => '活动核销码',
  22. # 后台菜单排序
  23. 'order' => 2,
  24. // 'menu' => false,
  25. # 数据结构
  26. 'struct' => array
  27. (
  28. 'id' => array
  29. (
  30. 'type' => 'int-11',
  31. 'name' => 'ID',
  32. 'default' => '',
  33. 'desc' => '',
  34. 'match' => 'is_numeric',
  35. 'search' => 'order',
  36. 'list' => true,
  37. 'order' => 'desc',
  38. ),
  39. 'active_id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => '活动名称',
  43. 'default' => '-1',
  44. 'desc' => '活动名称',
  45. 'match' => 'is_string',
  46. 'update' => 'hidden',
  47. // 'search' => 'text',
  48. 'list' => "Dever::load('active/lib/manage.active#active_name',{active_id})",
  49. ),
  50. 'order_id' => array
  51. (
  52. 'type' => 'int-11',
  53. 'name' => '订单名称',
  54. 'default' => '-1',
  55. 'desc' => '订单名称',
  56. 'match' => 'is_string',
  57. 'update' => 'hidden',
  58. // 'search' => 'text',
  59. // 'list' => true,
  60. ),
  61. 'join_uid' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => '参加人名称/手机号',
  65. 'default' => '-1',
  66. 'desc' => '用户名称',
  67. 'match' => 'is_string',
  68. // 'option' => $user,
  69. // 'update' => 'text',
  70. 'search' => array
  71. (
  72. 'api' => 'active/user-getSearch',
  73. 'col' => 'col',
  74. 'result' => 'id',
  75. 'search' => 'mid',
  76. ),
  77. 'list_name' => '参加人信息',
  78. 'list' => "Dever::load('active/lib/manage.user',{join_uid})",
  79. ),
  80. 'buy_uid' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '购买人姓名/手机号',
  84. 'default' => '-1',
  85. 'desc' => '用户名称',
  86. 'match' => 'is_string',
  87. // 'option' => $user,
  88. // 'update' => 'text',
  89. 'search' => array
  90. (
  91. 'api' => 'active/user-getSearch',
  92. 'col' => 'col',
  93. 'result' => 'id',
  94. 'search' => 'mid',
  95. ),
  96. 'list_name' => '购买人信息',
  97. 'list' => "Dever::load('active/lib/manage.user',{buy_uid})",
  98. ),
  99. 'write_code' => array
  100. (
  101. 'type' => 'varchar-200',
  102. 'name' => '核销码',
  103. 'default' => '',
  104. 'desc' => '核销码',
  105. 'match' => 'is_string',
  106. 'update' => 'text',
  107. 'search' => 'fulltext',
  108. 'list' => true,
  109. ),
  110. 'act_status' => array
  111. (
  112. 'type' => 'tinyint-1',
  113. 'name' => '活动状态',
  114. 'default' => '1',
  115. 'desc' => '活动状态',
  116. 'match' => 'is_numeric',
  117. // 'update' => 'radio',
  118. 'option' => $act_status,
  119. 'search' => 'select',
  120. 'list' => true,
  121. ),
  122. 'status' => array
  123. (
  124. 'type' => 'tinyint-1',
  125. 'name' => '核销状态',
  126. 'default' => '1',
  127. 'desc' => '核销状态',
  128. 'match' => 'is_numeric',
  129. 'option' => $status,
  130. 'search' => 'select',
  131. 'list' => true,
  132. ),
  133. 'pic' => array
  134. (
  135. 'type' => 'text-255',
  136. 'name' => '二维码',
  137. 'default' => '',
  138. 'desc' => '二维码',
  139. 'match' => 'option',
  140. 'update' => 'image',
  141. 'key' => '1',
  142. // 'place' => '759*562',
  143. ),
  144. 'offdate' => array
  145. (
  146. 'type' => 'int-11',
  147. 'name' => '核销时间',
  148. 'default' => '',
  149. 'match' => 'is_numeric',
  150. // 'search' => 'date',
  151. // 'desc' => '',
  152. // 'list' => 'date("Y-m-d H:i:s", {zdate})',
  153. ),
  154. 'audit_admin' => array
  155. (
  156. 'type' => 'int-11',
  157. 'name' => '核销操作人',
  158. 'default' => '',
  159. 'match' => 'is_numeric',
  160. 'desc' => '核销操作人',
  161. 'list' => 'Dever::load("active/lib/manage.active#admin_name",{id})',
  162. // '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
  163. // 'list_order' => 8,
  164. ),
  165. 'top_admin' => array
  166. (
  167. 'type' => 'int-11',
  168. 'name' => '前台核销操作人',
  169. 'default' => '',
  170. 'match' => 'is_numeric',
  171. 'desc' => '核销操作人',
  172. // 'list' => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
  173. // 'list_order' => 8,
  174. ),
  175. 'state' => array
  176. (
  177. 'type' => 'tinyint-1',
  178. 'name' => '状态',
  179. 'default' => '1',
  180. 'desc' => '请选择状态',
  181. 'match' => 'is_numeric',
  182. ),
  183. 'cdate' => array
  184. (
  185. 'type' => 'int-11',
  186. 'name' => '领取日期',
  187. 'match' => array('is_numeric', time()),
  188. 'desc' => '',
  189. # 只有insert时才生效
  190. 'insert' => true,
  191. 'search' => 'day',
  192. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  193. 'list_order' => 5,
  194. ),
  195. ),
  196. 'manage' => array
  197. (
  198. 'insert' => false,
  199. 'delete' => false,
  200. 'edit' => false,
  201. ),
  202. 'request' => array
  203. (
  204. 'getAll' => array
  205. (
  206. # 匹配的正则或函数 选填项
  207. 'option' => array
  208. (
  209. 'join_uid' => 'yes',
  210. 'state' => 1,
  211. ),
  212. 'type' => 'all',
  213. 'order' => array('cdate' => 'desc'),
  214. 'col' => '*',
  215. ),
  216. 'getCode' => array
  217. (
  218. # 匹配的正则或函数 选填项
  219. 'option' => array
  220. (
  221. 'order_id' => 'yes',
  222. 'status' => array('yes','in'),
  223. 'state' => 1,
  224. ),
  225. 'type' => 'all',
  226. 'order' => array('cdate' => 'desc'),
  227. 'col' => '*',
  228. ),
  229. ),
  230. );