info.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. $link = function()
  3. {
  4. $array = array
  5. (
  6. -1 => array('id' => -1, 'name' => '通用'),
  7. );
  8. $info = Dever::db('source/link')->state();
  9. if($info)
  10. {
  11. $array += $info;
  12. }
  13. return $array;
  14. };
  15. return array
  16. (
  17. # 表名
  18. 'name' => 'info',
  19. # 显示给用户看的名称
  20. 'lang' => '渠道管理',
  21. 'order' => 10,
  22. # 数据结构
  23. 'struct' => array
  24. (
  25. 'id' => array
  26. (
  27. 'type' => 'int-11',
  28. 'name' => 'ID',
  29. 'default' => '',
  30. 'desc' => '',
  31. 'match' => 'is_numeric',
  32. 'list' => true,
  33. ),
  34. 'name' => array
  35. (
  36. 'type' => 'varchar-80',
  37. 'name' => '名称',
  38. 'default' => '',
  39. 'desc' => '请输入名称',
  40. 'match' => 'is_string',
  41. 'update' => 'text',
  42. 'search' => 'fulltext',
  43. 'list' => true,
  44. ),
  45. 'link_id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '推广链接',
  49. 'default' => '-1',
  50. 'desc' => '推广链接',
  51. 'match' => 'is_numeric',
  52. 'update' => 'select',
  53. 'option' => $link,
  54. 'search' => 'select',
  55. 'list' => true,
  56. ),
  57. 'code' => array
  58. (
  59. 'type' => 'varchar-200',
  60. 'name' => '渠道二维码',
  61. 'default' => '',
  62. 'desc' => '渠道二维码',
  63. 'match' => 'option',
  64. //'update' => 'textarea',
  65. //'list' => 'Dever::load("source/lib/manage.show", "{id}")',
  66. ),
  67. 'state' => array
  68. (
  69. 'type' => 'tinyint-1',
  70. 'name' => '状态',
  71. 'default' => '1',
  72. 'desc' => '请选择状态',
  73. 'match' => 'is_numeric',
  74. ),
  75. 'cdate' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '录入时间',
  79. 'match' => array('is_numeric', time()),
  80. 'desc' => '',
  81. # 只有insert时才生效
  82. 'insert' => true,
  83. ),
  84. ),
  85. # 默认值
  86. 'default' => array
  87. (
  88. 'col' => 'name,link_id,state,cdate',
  89. 'value' => array
  90. (
  91. '"官方",-1,1,' . time(),
  92. ),
  93. ),
  94. 'manage' => array
  95. (
  96. 'delete' => false,
  97. 'edit' => false,
  98. # 列表
  99. 'list_buttons' => array
  100. (
  101. //'list' => array('渠道统计', '"stat&search_option_info_id={id}&oper_parent=info"'),
  102. ),
  103. ),
  104. );