buy_num.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. 'reorder' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '排序(数值越大越靠前)',
  93. 'default' => '1',
  94. 'desc' => '请输入排序',
  95. 'match' => 'option',
  96. 'update' => 'text',
  97. 'search' => 'order',
  98. 'list_name' => '排序',
  99. 'list' => true,
  100. 'order' => 'desc',
  101. 'edit' => true,
  102. ),
  103. 'state' => array
  104. (
  105. 'type' => 'tinyint-1',
  106. 'name' => '状态',
  107. 'default' => '1',
  108. 'desc' => '请选择状态',
  109. 'match' => 'is_numeric',
  110. ),
  111. 'cdate' => array
  112. (
  113. 'type' => 'int-11',
  114. 'name' => '添加时间',
  115. 'match' => array('is_numeric', time()),
  116. 'desc' => '',
  117. # 只有insert时才生效
  118. 'insert' => true,
  119. //'search' => 'date',
  120. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  121. ),
  122. ),
  123. 'manage' => array
  124. (
  125. ),
  126. 'request' => array
  127. (
  128. 'getAll' => array
  129. (
  130. # 匹配的正则或函数 选填项
  131. 'option' => array
  132. (
  133. 'info_id' => 'yes',
  134. 'state' => 1,
  135. ),
  136. 'type' => 'all',
  137. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  138. 'col' => '*',
  139. ),
  140. # 最低价格的
  141. 'getDataByMin' => array
  142. (
  143. # 匹配的正则或函数 选填项
  144. 'option' => array
  145. (
  146. 'info_id' => 'yes',
  147. 'state' => 1,
  148. ),
  149. 'type' => 'one',
  150. 'order' => array('cash' => 'asc','reorder' => 'desc', 'cdate' => 'desc'),
  151. 'col' => '*',
  152. ),
  153. ),
  154. );