info.php 16 KB

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