code.php 9.5 KB

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