object.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <?php
  2. # 定义几个常用的选项
  3. $status = array
  4. (
  5. 1 => '在线',
  6. 2 => '下线',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'object',
  12. # 显示给用户看的名称
  13. 'lang' => '购买项目设置',
  14. 'order' => 100,
  15. 'menu' => false,
  16. # 数据结构
  17. 'struct' => array
  18. (
  19. 'id' => array
  20. (
  21. 'type' => 'int-11',
  22. 'name' => 'ID',
  23. 'default' => '',
  24. 'desc' => '',
  25. 'match' => 'is_numeric',
  26. 'search' => 'order',
  27. //'list' => true,
  28. ),
  29. 'info_id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => '合集',
  33. 'default' => '',
  34. 'desc' => '合集',
  35. 'match' => 'is_numeric',
  36. 'update' => 'hidden',
  37. 'value' => Dever::input('search_option_info_id')
  38. ),
  39. 'name' => array
  40. (
  41. 'type' => 'varchar-80',
  42. 'name' => '项目名称',
  43. 'default' => '',
  44. 'desc' => '项目名称',
  45. 'match' => 'option',
  46. 'update' => 'text',
  47. //'search' => 'fulltext',
  48. 'list' => true,
  49. ),
  50. 'info' => array
  51. (
  52. 'type' => 'varchar-800',
  53. 'name' => '项目介绍',
  54. 'default' => '',
  55. 'desc' => '项目介绍',
  56. 'match' => 'option',
  57. 'update' => 'textarea',
  58. //'search' => 'fulltext',
  59. //'list' => true,
  60. ),
  61. 'avatar' => array
  62. (
  63. 'type' => 'varchar-150',
  64. 'name' => '项目图片-图片尺寸150*150px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  65. 'default' => '',
  66. 'desc' => '项目图片',
  67. 'match' => 'is_string',
  68. 'update' => 'image',
  69. 'key' => '1',
  70. 'place' => '150',
  71. ),
  72. 'num_buy' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '购买数',
  76. 'default' => '0',
  77. 'desc' => '请填写购买数',
  78. 'match' => 'option',
  79. 'search' => 'order',
  80. 'show' => 'buy=1',
  81. 'list' => 'Dever::load("collection/lib/manage.objectNum?id={id}")',
  82. 'list_name' => '统计数字',
  83. ),
  84. 'num_ratio_buy' => array
  85. (
  86. 'type' => 'varchar-20',
  87. 'name' => '购买系数-用以增加总购买量,系数不能小于等于0,支持两位小数,总购买量=(用户当前购买数+购买基数)*购买系数。',
  88. 'default' => '1',
  89. 'desc' => '手动增加购买系数',
  90. 'match' => 'is_string',
  91. 'update' => 'text',
  92. 'show' => 'buy=1',
  93. ),
  94. 'num_add_buy' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '购买基数',
  98. 'default' => '0',
  99. 'desc' => '手动增加阅读数',
  100. 'match' => 'option',
  101. 'update' => 'text',
  102. 'show' => 'buy=1',
  103. ),
  104. 'reorder' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '排序(数值越大越靠前)',
  108. 'default' => '1',
  109. 'desc' => '请输入排序',
  110. 'match' => 'option',
  111. 'update' => 'text',
  112. 'search' => 'order',
  113. 'list_name' => '排序',
  114. 'list' => true,
  115. 'order' => 'desc',
  116. 'edit' => true,
  117. ),
  118. 'state' => array
  119. (
  120. 'type' => 'tinyint-1',
  121. 'name' => '状态',
  122. 'default' => '1',
  123. 'desc' => '请选择状态',
  124. 'match' => 'is_numeric',
  125. ),
  126. 'cdate' => array
  127. (
  128. 'type' => 'int-11',
  129. 'name' => '添加时间',
  130. 'match' => array('is_numeric', time()),
  131. 'desc' => '',
  132. # 只有insert时才生效
  133. 'insert' => true,
  134. //'search' => 'date',
  135. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  136. ),
  137. ),
  138. 'manage' => array
  139. (
  140. ),
  141. 'request' => array
  142. (
  143. 'getAll' => array
  144. (
  145. # 匹配的正则或函数 选填项
  146. 'option' => array
  147. (
  148. 'info_id' => 'yes',
  149. 'state' => 1,
  150. ),
  151. 'type' => 'all',
  152. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  153. 'col' => '*',
  154. ),
  155. ),
  156. );