info.php 15 KB

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