info.php 17 KB

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