info.php 17 KB

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