buy_num.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <?php
  2. # 定义几个常用的选项
  3. $status = array
  4. (
  5. 1 => '在线',
  6. 2 => '下线',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'buy_num',
  12. # 显示给用户看的名称
  13. 'lang' => '购买本数设置',
  14. 'order' => 100,
  15. 'menu' => false,
  16. 'end' => array
  17. (
  18. 'insert' => 'journal/lib/manage.setBuyCache',
  19. 'update' => 'journal/lib/manage.setBuyCache',
  20. ),
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'search' => 'order',
  32. //'list' => true,
  33. ),
  34. 'info_id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '小刊',
  38. 'default' => '',
  39. 'desc' => '小刊',
  40. 'match' => 'is_numeric',
  41. 'update' => 'hidden',
  42. 'value' => Dever::input('search_option_info_id')
  43. ),
  44. 'num' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '购买本数-直接填写购买的小刊本数数字即可',
  48. 'default' => '1',
  49. 'desc' => '购买本数',
  50. 'match' => 'option',
  51. 'update' => 'text',
  52. //'search' => 'fulltext',
  53. 'list' => true,
  54. ),
  55. 'name' => array
  56. (
  57. 'type' => 'varchar-80',
  58. 'name' => '购买名称-一般为“购买n本”,如购买1本,如果为空,则根据购买本数自动生成如“购买n本”',
  59. 'default' => '',
  60. 'desc' => '购买名称',
  61. 'match' => 'option',
  62. 'update' => 'text',
  63. //'search' => 'fulltext',
  64. 'list' => 'Dever::load("journal/lib/manage.getName", {id})',
  65. ),
  66. 'price' => array
  67. (
  68. 'type' => 'varchar-50',
  69. 'name' => '购买时的标价-为空则自动根据小刊的单本支付价格计算',
  70. 'default' => '',
  71. 'desc' => '购买时的标价',
  72. 'match' => 'option',
  73. 'update' => 'text',
  74. 'list' => 'Dever::load("journal/lib/manage.getPrice", {id})',
  75. ),
  76. 'cash' => array
  77. (
  78. 'type' => 'varchar-50',
  79. 'name' => '支付价格-实际支付价格,单位元,直接填写数字即可',
  80. 'default' => '',
  81. 'desc' => '支付价格',
  82. 'match' => 'is_string',
  83. //'update' => 'text',
  84. ),
  85. 'score' => array
  86. (
  87. 'type' => 'varchar-80',
  88. 'name' => '增加积分数-直接填写购买当前本数设置,用户能获得的积分,设置之后,积分规则里的设置将失效',
  89. 'default' => '',
  90. 'desc' => '增加积分数',
  91. 'match' => 'is_string',
  92. //'update' => 'text',
  93. ),
  94. 'code' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '生成兑换码数量-直接填写购买当前本数所能得到的兑换码数,默认为1',
  98. 'default' => '1',
  99. 'desc' => '生成兑换码数量',
  100. 'match' => 'option',
  101. 'update' => 'text',
  102. //'search' => 'fulltext',
  103. 'list' => true,
  104. ),
  105. 'reorder' => array
  106. (
  107. 'type' => 'int-11',
  108. 'name' => '排序(数值越大越靠前)',
  109. 'default' => '1',
  110. 'desc' => '请输入排序',
  111. 'match' => 'option',
  112. 'update' => 'text',
  113. 'search' => 'order',
  114. 'list_name' => '排序',
  115. 'list' => true,
  116. 'order' => 'desc',
  117. 'edit' => true,
  118. ),
  119. 'state' => array
  120. (
  121. 'type' => 'tinyint-1',
  122. 'name' => '状态',
  123. 'default' => '1',
  124. 'desc' => '请选择状态',
  125. 'match' => 'is_numeric',
  126. ),
  127. 'cdate' => array
  128. (
  129. 'type' => 'int-11',
  130. 'name' => '添加时间',
  131. 'match' => array('is_numeric', time()),
  132. 'desc' => '',
  133. # 只有insert时才生效
  134. 'insert' => true,
  135. //'search' => 'date',
  136. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  137. ),
  138. ),
  139. 'manage' => array
  140. (
  141. ),
  142. 'request' => array
  143. (
  144. 'getAll' => array
  145. (
  146. # 匹配的正则或函数 选填项
  147. 'option' => array
  148. (
  149. 'info_id' => 'yes',
  150. //'code' => 1,
  151. 'state' => 1,
  152. ),
  153. 'type' => 'all',
  154. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  155. 'col' => '*',
  156. ),
  157. 'getAlls' => array
  158. (
  159. # 匹配的正则或函数 选填项
  160. 'option' => array
  161. (
  162. 'info_id' => 'yes',
  163. 'code' => 1,
  164. 'state' => 1,
  165. ),
  166. 'type' => 'all',
  167. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  168. 'col' => '*',
  169. ),
  170. # 最低价格的
  171. 'getDataByMin' => array
  172. (
  173. # 匹配的正则或函数 选填项
  174. 'option' => array
  175. (
  176. 'info_id' => 'yes',
  177. 'state' => 1,
  178. ),
  179. 'type' => 'one',
  180. 'order' => array('cash' => 'asc','reorder' => 'desc', 'cdate' => 'desc'),
  181. 'col' => '*',
  182. ),
  183. 'getAllCode' => array
  184. (
  185. # 匹配的正则或函数 选填项
  186. 'option' => array
  187. (
  188. 'info_id' => 'yes',
  189. 'code' => 1,
  190. 'state' => 1,
  191. ),
  192. 'type' => 'all',
  193. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  194. 'col' => '*',
  195. ),
  196. 'getAllCodes' => array
  197. (
  198. # 匹配的正则或函数 选填项
  199. 'option' => array
  200. (
  201. 'info_id' => 'yes',
  202. //'code' => array(1, '>'),
  203. 'state' => 1,
  204. ),
  205. 'type' => 'all',
  206. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  207. 'col' => '*',
  208. ),
  209. ),
  210. );