code.php 10 KB

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