code.php 9.2 KB

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