journal_num.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. $table = Dever::config('base')->type;
  3. return array
  4. (
  5. # 表名
  6. 'name' => 'journal_num',
  7. # 显示给用户看的名称
  8. 'lang' => '本数排行榜',
  9. # 是否显示在后台菜单
  10. 'order' => 1,
  11. 'menu' => false,
  12. # 数据结构
  13. 'struct' => array
  14. (
  15. 'id' => array
  16. (
  17. 'type' => 'int-11',
  18. 'name' => 'ID',
  19. 'default' => '',
  20. 'desc' => '',
  21. 'match' => 'is_numeric',
  22. 'order' => 'desc',
  23. 'list' => true,
  24. ),
  25. 'uid' => array
  26. (
  27. 'type' => 'int-11',
  28. 'name' => '用户名',
  29. 'default' => '0',
  30. 'desc' => '请选择用户',
  31. 'match' => 'is_numeric',
  32. 'update' => 'text',
  33. //'search' => 'select',
  34. 'search' => array
  35. (
  36. 'api' => 'passport/user-all',
  37. 'col' => 'username',
  38. 'result' => 'id',
  39. ),
  40. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  41. ),
  42. 'journal_id' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '电子刊ID',
  46. 'default' => '',
  47. 'desc' => '电子刊ID',
  48. 'update' => 'text',
  49. 'match' => 'option',
  50. ),
  51. 'num' => array
  52. (
  53. 'type' => 'int-11',
  54. 'name' => '购买本数',
  55. 'default' => '',
  56. 'desc' => '购买本数',
  57. 'match' => 'option',
  58. 'update' => 'text',
  59. 'order' => 'desc',
  60. 'list' => true,
  61. ),
  62. 'state' => array
  63. (
  64. 'type' => 'tinyint-1',
  65. 'name' => '状态',
  66. 'default' => '1',
  67. 'desc' => '请选择状态',
  68. 'match' => 'is_numeric',
  69. ),
  70. 'cdate' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => '时间',
  74. 'match' => array('is_numeric', time()),
  75. 'desc' => '',
  76. # 只有insert时才生效
  77. 'insert' => true,
  78. //'search' => 'date',
  79. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  80. ),
  81. ),
  82. 'manage' => array
  83. (
  84. //'insert' => false,
  85. //'edit' => false,
  86. //'delete' => false,
  87. 'button' => array
  88. (
  89. '导出排行榜' => array('location', 'act/lib/num.out?id=' . Dever::input('search_option_journal_id')),
  90. ),
  91. ),
  92. # request 请求接口定义
  93. 'request' => array
  94. (
  95. 'getAll' => array
  96. (
  97. # 匹配的正则或函数 选填项
  98. 'option' => array
  99. (
  100. 'uid' => 'yes',
  101. 'journal_id' => 'yes',
  102. 'state' => 1,
  103. ),
  104. 'type' => 'all',
  105. 'order' => array('num' => 'desc','id' => 'desc'),
  106. //'page' => array(100, 'list'),
  107. 'limit' => '0,50',
  108. 'col' => '*',
  109. ),
  110. )
  111. );