member.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. ),
  66. 'start' => array
  67. (
  68. 'type' => 'int-11',
  69. 'default' => '',
  70. 'name' => '开始时间',
  71. 'match' => 'is_numeric',
  72. 'desc' => '开始时间',
  73. 'update' => 'date',
  74. 'list' => 'date("Y-m-d H:i:s", {start})',
  75. 'callback' => 'maketime',
  76. ),
  77. 'end' => array
  78. (
  79. 'type' => 'int-11',
  80. 'default' => '',
  81. 'name' => '结束时间',
  82. 'match' => 'is_numeric',
  83. 'desc' => '结束时间',
  84. 'update' => 'date',
  85. 'list' => 'date("Y-m-d H:i:s", {end})',
  86. 'callback' => 'maketime',
  87. ),
  88. 'cate_id' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '小刊分类',
  92. 'default' => '1',
  93. 'desc' => '小刊分类',
  94. 'match' => 'is_numeric',
  95. //'update' => 'select',
  96. 'option' => $cate,
  97. //'search' => 'select',
  98. 'list' => true,
  99. ),
  100. 'state' => array
  101. (
  102. 'type' => 'tinyint-1',
  103. 'name' => '状态',
  104. 'default' => '1',
  105. 'desc' => '请选择状态',
  106. 'match' => 'is_numeric',
  107. ),
  108. 'cdate' => array
  109. (
  110. 'type' => 'int-11',
  111. 'name' => '最近购买时间',
  112. 'match' => array('is_numeric', time()),
  113. 'desc' => '',
  114. # 只有insert时才生效
  115. //'insert' => true,
  116. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  117. ),
  118. ),
  119. 'top' => Dever::config('base')->top,
  120. # 增加这个,为了给当前的list增加一个option
  121. 'top_option' => array
  122. (
  123. 'value' => $auth,
  124. 'col' => 'cate_id',
  125. ),
  126. 'manage' => array
  127. (
  128. 'insert' => false,
  129. //'edit' => false,
  130. 'delete' => false,
  131. ),
  132. 'request' => array
  133. (
  134. ),
  135. );