member.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?php
  2. # 获取小刊分类权限
  3. $auth = Dever::tops();
  4. $cate = function() use ($auth)
  5. {
  6. $array = array();
  7. if ($auth) {
  8. $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
  9. } else {
  10. $info = Dever::db('journal/cate')->state();
  11. }
  12. if($info)
  13. {
  14. $array += $info;
  15. }
  16. return $array;
  17. };
  18. return array
  19. (
  20. # 表名
  21. 'name' => 'member',
  22. # 显示给用户看的名称
  23. 'lang' => '会员管理',
  24. # 后台菜单排序
  25. 'order' => 20,
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => 'ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. 'search' => 'order',
  37. 'list' => true,
  38. 'order' => 'desc',
  39. ),
  40. 'uid' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '购买者用户名',
  44. 'default' => '',
  45. 'desc' => '购买者用户名',
  46. 'match' => 'is_numeric',
  47. 'search' => array
  48. (
  49. 'api' => 'passport/user-all',
  50. 'col' => 'username',
  51. 'result' => 'id',
  52. ),
  53. 'update' => 'text',
  54. ),
  55. 'mobile' => array
  56. (
  57. 'type' => 'varchar-300',
  58. 'name' => '手机号',
  59. 'default' => '',
  60. 'desc' => '手机号',
  61. 'match' => 'option',
  62. //'show' => 'status=5'
  63. 'search' => 'fulltext',
  64. 'list' => true,
  65. 'update' => 'text',
  66. ),
  67. 'start' => array
  68. (
  69. 'type' => 'int-11',
  70. 'default' => '',
  71. 'name' => '开始时间',
  72. 'match' => 'is_numeric',
  73. 'desc' => '开始时间',
  74. 'update' => 'date',
  75. 'list' => 'date("Y-m-d H:i:s", {start})',
  76. 'callback' => 'maketime',
  77. ),
  78. 'end' => array
  79. (
  80. 'type' => 'int-11',
  81. 'default' => '',
  82. 'name' => '结束时间',
  83. 'match' => 'is_numeric',
  84. 'desc' => '结束时间',
  85. 'update' => 'date',
  86. 'list' => 'date("Y-m-d H:i:s", {end})',
  87. 'callback' => 'maketime',
  88. ),
  89. 'cate_id' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '小刊分类',
  93. 'default' => '1',
  94. 'desc' => '小刊分类',
  95. 'match' => 'is_numeric',
  96. 'update' => 'select',
  97. 'option' => $cate,
  98. //'search' => 'select',
  99. 'list' => true,
  100. ),
  101. 'state' => array
  102. (
  103. 'type' => 'tinyint-1',
  104. 'name' => '状态',
  105. 'default' => '1',
  106. 'desc' => '请选择状态',
  107. 'match' => 'is_numeric',
  108. ),
  109. 'cdate' => array
  110. (
  111. 'type' => 'int-11',
  112. 'name' => '最近购买时间',
  113. 'match' => array('is_numeric', time()),
  114. 'desc' => '',
  115. # 只有insert时才生效
  116. //'insert' => true,
  117. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  118. ),
  119. ),
  120. 'top' => Dever::config('base')->top,
  121. # 增加这个,为了给当前的list增加一个option
  122. 'top_option' => array
  123. (
  124. 'value' => $auth,
  125. 'col' => 'cate_id',
  126. ),
  127. 'manage' => array
  128. (
  129. 'insert' => false,
  130. //'edit' => false,
  131. 'delete' => false,
  132. ),
  133. 'request' => array
  134. (
  135. ),
  136. );