buy_num.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. # 数据结构
  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. 'num' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => '购买本数-直接填写购买的小刊本数数字即可',
  43. 'default' => '1',
  44. 'desc' => '购买本数',
  45. 'match' => 'option',
  46. 'update' => 'text',
  47. //'search' => 'fulltext',
  48. 'list' => true,
  49. ),
  50. 'name' => array
  51. (
  52. 'type' => 'varchar-80',
  53. 'name' => '购买名称-一般为“购买n本”,如购买1本,如果为空,则根据购买本数自动生成如“购买n本”',
  54. 'default' => '',
  55. 'desc' => '购买名称',
  56. 'match' => 'option',
  57. 'update' => 'text',
  58. //'search' => 'fulltext',
  59. 'list' => 'Dever::load("journal/lib/manage.getName", {id})',
  60. ),
  61. 'price' => array
  62. (
  63. 'type' => 'varchar-50',
  64. 'name' => '购买时的标价-为空则自动根据小刊的单本支付价格计算',
  65. 'default' => '',
  66. 'desc' => '购买时的标价',
  67. 'match' => 'option',
  68. 'update' => 'text',
  69. 'list' => 'Dever::load("journal/lib/manage.getPrice", {id})',
  70. ),
  71. 'cash' => array
  72. (
  73. 'type' => 'varchar-50',
  74. 'name' => '支付价格-实际支付价格,单位元,直接填写数字即可',
  75. 'default' => '',
  76. 'desc' => '支付价格',
  77. 'match' => 'is_string',
  78. //'update' => 'text',
  79. ),
  80. 'score' => array
  81. (
  82. 'type' => 'varchar-80',
  83. 'name' => '增加积分数-直接填写购买当前本数设置,用户能获得的积分,设置之后,积分规则里的设置将失效',
  84. 'default' => '',
  85. 'desc' => '增加积分数',
  86. 'match' => 'is_string',
  87. //'update' => 'text',
  88. ),
  89. 'code' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '生成兑换码数量-直接填写购买当前本数所能得到的兑换码数,默认为1',
  93. 'default' => '1',
  94. 'desc' => '生成兑换码数量',
  95. 'match' => 'option',
  96. 'update' => 'text',
  97. //'search' => 'fulltext',
  98. 'list' => true,
  99. ),
  100. 'reorder' => array
  101. (
  102. 'type' => 'int-11',
  103. 'name' => '排序(数值越大越靠前)',
  104. 'default' => '1',
  105. 'desc' => '请输入排序',
  106. 'match' => 'option',
  107. 'update' => 'text',
  108. 'search' => 'order',
  109. 'list_name' => '排序',
  110. 'list' => true,
  111. 'order' => 'desc',
  112. 'edit' => true,
  113. ),
  114. 'state' => array
  115. (
  116. 'type' => 'tinyint-1',
  117. 'name' => '状态',
  118. 'default' => '1',
  119. 'desc' => '请选择状态',
  120. 'match' => 'is_numeric',
  121. ),
  122. 'cdate' => array
  123. (
  124. 'type' => 'int-11',
  125. 'name' => '添加时间',
  126. 'match' => array('is_numeric', time()),
  127. 'desc' => '',
  128. # 只有insert时才生效
  129. 'insert' => true,
  130. //'search' => 'date',
  131. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  132. ),
  133. ),
  134. 'manage' => array
  135. (
  136. ),
  137. 'request' => array
  138. (
  139. 'getAll' => array
  140. (
  141. # 匹配的正则或函数 选填项
  142. 'option' => array
  143. (
  144. 'info_id' => 'yes',
  145. 'code' => 1,
  146. 'state' => 1,
  147. ),
  148. 'type' => 'all',
  149. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  150. 'col' => '*',
  151. ),
  152. # 最低价格的
  153. 'getDataByMin' => array
  154. (
  155. # 匹配的正则或函数 选填项
  156. 'option' => array
  157. (
  158. 'info_id' => 'yes',
  159. 'state' => 1,
  160. ),
  161. 'type' => 'one',
  162. 'order' => array('cash' => 'asc','reorder' => 'desc', 'cdate' => 'desc'),
  163. 'col' => '*',
  164. ),
  165. 'getAllCode' => array
  166. (
  167. # 匹配的正则或函数 选填项
  168. 'option' => array
  169. (
  170. 'info_id' => 'yes',
  171. 'code' => 1,
  172. 'state' => 1,
  173. ),
  174. 'type' => 'all',
  175. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  176. 'col' => '*',
  177. ),
  178. 'getAllCodes' => array
  179. (
  180. # 匹配的正则或函数 选填项
  181. 'option' => array
  182. (
  183. 'info_id' => 'yes',
  184. 'code' => array(1, '>'),
  185. 'state' => 1,
  186. ),
  187. 'type' => 'all',
  188. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  189. 'col' => '*',
  190. ),
  191. ),
  192. );