info.php 14 KB

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