info.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  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. $type = array
  17. (
  18. //1 => '商品预售',
  19. 2 => '活动门票',
  20. );
  21. $online = array
  22. (
  23. 1 => '发布',
  24. 2 => '未发布',
  25. );
  26. $cost_type = array
  27. (
  28. //1 => '押金报名',
  29. 2 => '缴费报名',
  30. );
  31. $col_set = array
  32. (
  33. 'idcard' => '身份证号',
  34. );
  35. $refund_type = array
  36. (
  37. 1 => '不可以退款',
  38. 2 => '可以退款',
  39. );
  40. $role = function()
  41. {
  42. $array = array();
  43. $data = Dever::load('setting/lib/manage.role');
  44. if($data)
  45. {
  46. $array += $data;
  47. }
  48. return $array;
  49. };
  50. #权限:1=活动列表,2=核销管理
  51. $search_auth = Dever::input('search_option_dever_auth',1);
  52. $insert = false;
  53. $edit = false;
  54. $button = array();
  55. $list_button = array();
  56. if ($search_auth == 1) {
  57. $insert = true;
  58. $edit = true;
  59. if (Dever::load('manage/auth')->checkFunc('active.info', 'editworld', '自定义字段设置')) {
  60. $list_button['list1'] = array('自定义字段设置', '"info_field&search_option_active_id={id}&oper_table=info"');
  61. }
  62. if (Dever::load('manage/auth')->checkFunc('active.info', 'editcode', '生成核销码')) {
  63. $list_button['fast_add'] = array('生成核销码', '"create_code&search_option_active_id={id}"');
  64. }
  65. } else {
  66. if (Dever::load('manage/auth')->checkFunc('active.info_1', 'editOff', '核销活动')) {
  67. // $button['核销活动'] = array('fast',1,'info_code');
  68. $list_button['fast_add'] = array('手动核销', 'info_code&search_option_active_id={id}');
  69. $list_button['location'] = array('扫码核销',Dever::url('lib/manage.code','active'));
  70. }
  71. }
  72. $off = function() use($search_auth)
  73. {
  74. $array = array();
  75. $data = Dever::load('active/info_off-getData', array('id' => 1));
  76. if($data)
  77. {
  78. $array += $data;
  79. }
  80. return $array;
  81. };
  82. $col = Dever::input('col');
  83. if (!$col) {
  84. $tab = array('基础设置', '时间设置', '购买设置', '其他设置');
  85. } else {
  86. $tab = '';
  87. }
  88. $attr = function()
  89. {
  90. $auth = Dever::load('active/lib/manage.get',false);
  91. // $auth = Dever::load('attr/api.get', false);
  92. return $auth;
  93. };
  94. return array
  95. (
  96. # 表名
  97. 'name' => 'info',
  98. # 显示给用户看的名称
  99. 'lang' => '活动列表',
  100. # 后台菜单排序
  101. 'order' => 2,
  102. 'config_act_status' => $act_status,
  103. # 数据结构
  104. 'struct' => array
  105. (
  106. 'id' => array
  107. (
  108. 'type' => 'int-11',
  109. 'name' => 'ID',
  110. 'default' => '',
  111. 'desc' => '',
  112. 'match' => 'is_numeric',
  113. 'search' => 'order',
  114. 'list' => true,
  115. 'order' => 'desc',
  116. ),
  117. 'name' => array
  118. (
  119. 'type' => 'varchar-200',
  120. 'name' => '活动名称',
  121. 'default' => '',
  122. 'desc' => '活动名称',
  123. 'match' => 'is_string',
  124. 'update' => 'text',
  125. 'search' => 'fulltext',
  126. 'list' => true,
  127. ),
  128. 'address' => array
  129. (
  130. 'type' => 'varchar-200',
  131. 'name' => '活动地址',
  132. 'default' => '',
  133. 'desc' => '活动地址',
  134. 'match' => 'option',
  135. 'update' => 'text',
  136. // 'search' => 'fulltext',
  137. // 'list' => true,
  138. ),
  139. 'banner' => array
  140. (
  141. 'type' => 'text-255',
  142. 'name' => '详情顶部图片',
  143. 'default' => '',
  144. 'desc' => '顶部图片',
  145. 'match' => 'is_string',
  146. 'update' => 'image',
  147. 'key' => '1',
  148. // 'place' => '759*562',
  149. ),
  150. 'sign_start' => array
  151. (
  152. 'type' => 'int-11',
  153. 'name' => '报名开始时间',
  154. 'match' => 'option',
  155. 'default' => '0',
  156. 'desc' => '',
  157. 'match' => 'option',
  158. 'update' => 'date',
  159. 'search' => $search_auth == 1 ? 'date_start' : false,
  160. 'callback' => 'maketime',
  161. 'tab' => 1,
  162. // 'list' => '{buy_date} > 0 ? date("Y-m-d H:i", {buy_date}) : "无"',
  163. ),
  164. 'sign_end' => array
  165. (
  166. 'type' => 'int-11',
  167. 'name' => '报名结束时间',
  168. 'match' => 'option',
  169. 'default' => '0',
  170. 'desc' => '',
  171. 'match' => 'option',
  172. 'update' => 'date',
  173. 'search' => $search_auth == 1 ? 'date_end' : false,
  174. 'callback' => 'maketime',
  175. 'tab' => 1,
  176. // 'list' => '{buy_date} > 0 ? date("Y-m-d H:i", {buy_date}) : "无"',
  177. ),
  178. 'act_start' => array
  179. (
  180. 'type' => 'int-11',
  181. 'name' => '活动开始时间',
  182. 'match' => 'option',
  183. 'default' => '0',
  184. 'desc' => '',
  185. 'match' => 'is_numeric',
  186. 'update' => 'date',
  187. 'search' => $search_auth == 1 ? 'date_start' : false,
  188. 'callback' => 'maketime',
  189. 'list' => $search_auth == 2 ? 'date("Y-m-d H:i", {act_start})' : false,
  190. 'tab' => 1,
  191. ),
  192. 'act_end' => array
  193. (
  194. 'type' => 'int-11',
  195. 'name' => '活动结束时间',
  196. 'match' => 'option',
  197. 'default' => '0',
  198. 'desc' => '',
  199. 'match' => 'is_numeric',
  200. 'update' => 'date',
  201. 'search' => $search_auth == 1 ? 'date_end' : false,
  202. 'callback' => 'maketime',
  203. 'list' => $search_auth == 2 ? 'date("Y-m-d H:i", {act_end})' : false,
  204. 'tab' => 1,
  205. ),
  206. 'status' => array
  207. (
  208. 'type' => 'tinyint-1',
  209. 'name' => '报名限制',
  210. 'default' => '1',
  211. 'desc' => '报名限制',
  212. 'match' => 'is_numeric',
  213. 'update' => 'radio',
  214. 'option' => $status,
  215. // 'search' => 'select',
  216. 'list_name' => $search_auth == 2 ? '待核销数量' : false,
  217. 'list' => $search_auth == 2 ? "Dever::load('active/lib/manage.dOff',{id})" : false,
  218. 'tab' => 2,
  219. ),
  220. 'type' => array
  221. (
  222. 'type' => 'tinyint-1',
  223. 'name' => '活动类型',
  224. 'default' => '2',
  225. 'desc' => '活动类型',
  226. 'match' => 'is_numeric',
  227. 'update' => 'radio',
  228. 'option' => $type,
  229. // 'search' => 'select',
  230. // 'list' => $search_auth == 1 ? true : false,
  231. 'tab' => 2,
  232. ),
  233. 'act_status' => array
  234. (
  235. 'type' => 'tinyint-1',
  236. 'name' => '活动状态',
  237. 'default' => '1',
  238. 'desc' => '活动状态',
  239. 'match' => 'is_numeric',
  240. // 'update' => 'radio',
  241. 'option' => $act_status,
  242. 'search' => 'select',
  243. 'list' => $search_auth == 1 ? true : false,
  244. 'tab' => 1,
  245. ),
  246. 'online' => array
  247. (
  248. 'type' => 'tinyint-1',
  249. 'name' => '状态',
  250. 'default' => '1',
  251. 'desc' => '状态',
  252. 'match' => 'is_numeric',
  253. 'update' => 'radio',
  254. 'option' => $online,
  255. // 'search' => 'select',
  256. 'list' => $search_auth == 1 ? true : false,
  257. 'edit' => true,
  258. 'tab' => 2,
  259. ),
  260. 'num' => array
  261. (
  262. 'type' => 'int-11',
  263. 'name' => '限购数量-单位:张',
  264. 'default' => '0',
  265. 'desc' => '限购数量',
  266. 'match' => 'option',
  267. 'update' => 'text',
  268. // 'search' => 'fulltext',
  269. // 'list' => true,
  270. 'tab' => 2,
  271. ),
  272. 'attr' => array
  273. (
  274. 'type' => 'varchar-800',
  275. 'name' => '头衔购买数量设置',
  276. 'default' => '',
  277. 'desc' => '属性设置',
  278. 'match' => 'option',
  279. 'update' => 'checkbox',
  280. 'option' => $attr,
  281. 'update_input' => '',
  282. 'update_input_default' => '',
  283. 'update_parent' => 'checkbox',
  284. // 'list' => 'Dever::load("attr/api.string", "{attr}", "{attr_input}")',
  285. 'tab' => 2,
  286. ),
  287. 'attr_input' => array
  288. (
  289. 'type' => 'text-255',
  290. 'name' => '属性值设置',
  291. 'default' => '',
  292. 'desc' => '属性值设置',
  293. 'match' => 'option',
  294. 'updte' => 'textarea',
  295. 'tab' => 2,
  296. ),
  297. // 'title' => array
  298. // (
  299. // 'type' => 'text-1000',
  300. // 'name' => '头衔购买数量',
  301. // 'default' => '',
  302. // 'desc' => '头衔购买数量',
  303. // 'match' => 'option',
  304. // 'update' => array
  305. // (
  306. // array
  307. // (
  308. // 'col' => 'title',
  309. // 'name' => '头衔名称',
  310. // 'default' => '',
  311. // 'desc' => '头衔名称',
  312. // 'match' => 'is_string',
  313. // 'update' => 'select',
  314. // 'option' => $role,
  315. // 'tab' => 2,
  316. // ),
  317. // array
  318. // (
  319. // 'col' => 'num',
  320. // 'name' => '限购数量-单位:张',
  321. // 'default' => '0',
  322. // 'desc' => '限购数量',
  323. // 'match' => 'is_string',
  324. // 'update' => 'text',
  325. // 'search' => 'fulltext',
  326. // 'tab' => 2,
  327. // ),
  328. // ),
  329. // 'tab' => 2,
  330. // ),
  331. 'price' => array
  332. (
  333. 'type' => 'decimal-11,2',
  334. 'name' => '票价-单位:元',
  335. 'default' => '0',
  336. 'desc' => '票价-单位:元',
  337. 'match' => 'option',
  338. 'update' => 'text',
  339. 'list' => $search_auth == 1 ? true : false,
  340. 'list_order' => '3',
  341. 'tab' => 2,
  342. ),
  343. 'cost_type' => array
  344. (
  345. 'type' => 'tinyint-1',
  346. 'name' => '费用类型',
  347. 'default' => '2',
  348. 'desc' => '费用类型',
  349. 'match' => 'is_numeric',
  350. 'update' => 'radio',
  351. 'option' => $cost_type,
  352. // 'search' => 'select',
  353. // 'list' => true,
  354. 'tab' => 2,
  355. ),
  356. 'cover' => array
  357. (
  358. 'type' => 'text-255',
  359. 'name' => '列表封面图片',
  360. 'default' => '',
  361. 'desc' => '列表封面图片',
  362. 'match' => 'option',
  363. 'update' => 'image',
  364. 'key' => '1',
  365. // 'place' => '759*562',
  366. // 'tab' => 3,
  367. ),
  368. 'pic' => array
  369. (
  370. 'type' => 'text-255',
  371. 'name' => '购买成功后的背景图',
  372. 'default' => '',
  373. 'desc' => '购买成功后的背景图',
  374. 'match' => 'option',
  375. //'update' => 'image',
  376. 'key' => '1',
  377. // 'place' => '759*562',
  378. 'tab' => 3,
  379. ),
  380. 'col' => array
  381. (
  382. 'type' => 'varchar-300',
  383. 'name' => '字段设置',
  384. 'default' => 'idcard',
  385. 'desc' => '字段设置',
  386. 'match' => 'option',
  387. 'update' => 'checkbox',
  388. 'option' => $col_set,
  389. 'tab' => 3,
  390. ),
  391. 'mobile' => array
  392. (
  393. 'type' => 'bigint-11',
  394. 'name' => '客服电话',
  395. 'default' => '',
  396. 'desc' => '请输入客服电话',
  397. 'match' => 'option',
  398. 'update' => 'text',
  399. //'search' => 'fulltext',
  400. // 'list' => true,
  401. 'tab' => 3,
  402. ),
  403. 'share_name' => array
  404. (
  405. 'type' => 'varchar-300',
  406. 'name' => '分享内容-{member}代表分享人的名称,{active}代表活动名称,比如:您的好友{member},分享给你一个核销码,欢迎您参加:{active}活动名称,请点击链接填写资料认领',
  407. 'default' => '',
  408. 'desc' => '分享内容',
  409. 'match' => 'is_string',
  410. 'update' => 'textarea',
  411. 'tab' => 3,
  412. ),
  413. 'share_pic' => array
  414. (
  415. 'type' => 'text-255',
  416. 'name' => '分享图片',
  417. 'default' => '',
  418. 'desc' => '分享图片',
  419. 'match' => 'option',
  420. 'update' => 'image',
  421. 'key' => '1',
  422. // 'place' => '759*562',
  423. 'tab' => 3,
  424. ),
  425. 'refund_type' => array
  426. (
  427. 'type' => 'tinyint-1',
  428. 'name' => '是否可以退款',
  429. 'default' => '1',
  430. 'desc' => '是否可以退款',
  431. 'match' => 'is_numeric',
  432. 'update' => 'radio',
  433. 'option' => $refund_type,
  434. // 'search' => 'select',
  435. // 'list' => true,
  436. 'tab' => 3,
  437. ),
  438. 'desc' => array
  439. (
  440. 'type' => 'text-1000',
  441. 'name' => '活动说明',
  442. 'default' => '',
  443. 'desc' => '活动说明',
  444. 'match' => 'is_string',
  445. 'update' => 'editor',
  446. //'search' => 'fulltext',
  447. //'list' => true,
  448. 'tab' => 0,
  449. ),
  450. 'off_id' => array
  451. (
  452. 'type' => 'varchar-100',
  453. 'name' => '核销人员',
  454. 'default' => '1',
  455. 'desc' => '核销人员',
  456. 'match' => 'option',
  457. // 'search' => 'selects',
  458. 'update' => 'checkbox',
  459. 'option' => $off,
  460. // 'list' => $search_auth == 2 ? true : false,
  461. ),
  462. 'reorder' => array
  463. (
  464. 'type' => 'int-11',
  465. 'name' => '排序-数值越大越靠前',
  466. 'default' => '1',
  467. 'desc' => '请输入排序',
  468. 'match' => 'option',
  469. 'update' => 'text',
  470. 'search' => 'order',
  471. // 'list' => true,
  472. // 'order' => 'desc',
  473. // 'edit' => true,
  474. ),
  475. 'state' => array
  476. (
  477. 'type' => 'tinyint-1',
  478. 'name' => '状态',
  479. 'default' => '1',
  480. 'desc' => '请选择状态',
  481. 'match' => 'is_numeric',
  482. ),
  483. 'cdate' => array
  484. (
  485. 'type' => 'int-11',
  486. 'name' => '创建时间',
  487. 'match' => array('is_numeric', time()),
  488. 'desc' => '',
  489. # 只有insert时才生效
  490. 'insert' => true,
  491. 'list' => $search_auth == 1 ? 'date("Y-m-d H:i:s", {cdate})' : false,
  492. ),
  493. ),
  494. 'alter' => array
  495. (
  496. 2 => array
  497. (
  498. array('update', 'desc', 'desc', 'text-1000 活动说明'),
  499. ),
  500. 3 => array
  501. (
  502. array('update', 'mobile', 'mobile', 'varchar-100 客服电话'),
  503. ),
  504. 'version' => 3,
  505. ),
  506. 'manage' => array
  507. (
  508. 'insert' => $insert,
  509. 'delete' => false,
  510. 'edit' => $edit,
  511. 'list_button' => $list_button,
  512. 'button' => $button,
  513. 'tab' => $tab,
  514. ),
  515. 'request' => array
  516. (
  517. 'getSearch' => array
  518. (
  519. # 匹配的正则或函数 选填项
  520. 'option' => array
  521. (
  522. 'col' => array('yes-name', 'like'),
  523. ),
  524. 'type' => 'all',
  525. 'col' => '*|id',
  526. ),
  527. 'getAll' => array
  528. (
  529. # 匹配的正则或函数 选填项
  530. 'option' => array
  531. (
  532. 'off_id' => array('yes','like'),
  533. 'online' => 1,
  534. 'state' => 1,
  535. ),
  536. 'type' => 'all',
  537. 'order' => array('reorder' => 'desc', 'act_status' => 'asc'),
  538. 'col' => 'id,name,banner,act_status,sign_end,act_start,act_end,sign_start,cdate,cover',
  539. ),
  540. ),
  541. );