buy.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <?php
  2. # 定义几个常用的选项
  3. $status = array
  4. (
  5. 1 => '在线',
  6. 2 => '下线',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'buy',
  12. # 显示给用户看的名称
  13. 'lang' => '购买设置',
  14. 'order' => 100,
  15. 'menu' => false,
  16. 'ends' => array
  17. (
  18. 'insert' => 'magazine/lib/manage.setBuyCache',
  19. 'update' => 'magazine/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("magazine/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("magazine/lib/manage.getPrice", {id})',
  75. ),
  76. 'code' => array
  77. (
  78. 'type' => 'int-11',
  79. 'name' => '生成门票数量-直接填写购买当前本数所能得到的门票数,默认为1',
  80. 'default' => '1',
  81. 'desc' => '生成门票数量',
  82. 'match' => 'option',
  83. 'update' => 'text',
  84. //'search' => 'fulltext',
  85. 'list' => true,
  86. ),
  87. 'reorder' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '排序(数值越大越靠前)',
  91. 'default' => '1',
  92. 'desc' => '请输入排序',
  93. 'match' => 'option',
  94. 'update' => 'text',
  95. 'search' => 'order',
  96. 'list_name' => '排序',
  97. 'list' => true,
  98. 'order' => 'desc',
  99. 'edit' => true,
  100. ),
  101. 'state' => array
  102. (
  103. 'type' => 'tinyint-1',
  104. 'name' => '状态',
  105. 'default' => '1',
  106. 'desc' => '请选择状态',
  107. 'match' => 'is_numeric',
  108. ),
  109. 'cdate' => array
  110. (
  111. 'type' => 'int-11',
  112. 'name' => '添加时间',
  113. 'match' => array('is_numeric', time()),
  114. 'desc' => '',
  115. # 只有insert时才生效
  116. 'insert' => true,
  117. //'search' => 'date',
  118. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  119. ),
  120. ),
  121. 'manage' => array
  122. (
  123. ),
  124. 'request' => array
  125. (
  126. 'getAll' => array
  127. (
  128. # 匹配的正则或函数 选填项
  129. 'option' => array
  130. (
  131. 'info_id' => 'yes',
  132. 'state' => 1,
  133. ),
  134. 'type' => 'all',
  135. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  136. 'col' => '*',
  137. ),
  138. ),
  139. );