buy.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. # 定义几个常用的选项
  3. $status = Dever::config('base')->status;
  4. return array
  5. (
  6. # 表名
  7. 'name' => 'buy',
  8. # 显示给用户看的名称
  9. 'lang' => '购买设置',
  10. 'order' => 100,
  11. 'menu' => false,
  12. 'ends' => array
  13. (
  14. 'insert' => 'collection/lib/manage.setBuyCache',
  15. 'update' => 'collection/lib/manage.setBuyCache',
  16. ),
  17. # 数据结构
  18. 'struct' => array
  19. (
  20. 'id' => array
  21. (
  22. 'type' => 'int-11',
  23. 'name' => 'ID',
  24. 'default' => '',
  25. 'desc' => '',
  26. 'match' => 'is_numeric',
  27. 'search' => 'order',
  28. //'list' => true,
  29. ),
  30. 'info_id' => array
  31. (
  32. 'type' => 'int-11',
  33. 'name' => '合集',
  34. 'default' => '',
  35. 'desc' => '合集',
  36. 'match' => 'is_numeric',
  37. 'update' => 'hidden',
  38. 'value' => Dever::input('search_option_info_id')
  39. ),
  40. 'num' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '购买数量-直接填写购买的数字即可',
  44. 'default' => '1',
  45. 'desc' => '购买数量',
  46. 'match' => 'option',
  47. 'update' => 'text',
  48. 'search' => 'order',
  49. 'list' => true,
  50. 'order' => 'asc',
  51. ),
  52. 'name' => array
  53. (
  54. 'type' => 'varchar-80',
  55. 'name' => '购买名称-一般为“购买n张”,如购买1张,如果为空,则根据购买本数自动生成如“购买n张”',
  56. 'default' => '',
  57. 'desc' => '购买名称',
  58. 'match' => 'option',
  59. 'update' => 'text',
  60. //'search' => 'fulltext',
  61. 'list' => 'Dever::load("collection/lib/buy.getName", {id})',
  62. ),
  63. 'price' => array
  64. (
  65. 'type' => 'varchar-50',
  66. 'name' => '购买时的标价-为空则自动根据合集的门票单张支付价格计算',
  67. 'default' => '',
  68. 'desc' => '购买时的标价',
  69. 'match' => 'option',
  70. 'update' => 'text',
  71. 'list' => 'Dever::load("collection/lib/buy.getPriceName", {id})',
  72. ),
  73. 'state' => array
  74. (
  75. 'type' => 'tinyint-1',
  76. 'name' => '状态',
  77. 'default' => '1',
  78. 'desc' => '请选择状态',
  79. 'match' => 'is_numeric',
  80. ),
  81. 'cdate' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '添加时间',
  85. 'match' => array('is_numeric', time()),
  86. 'desc' => '',
  87. # 只有insert时才生效
  88. 'insert' => true,
  89. //'search' => 'date',
  90. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  91. ),
  92. ),
  93. 'manage' => array
  94. (
  95. ),
  96. 'request' => array
  97. (
  98. 'getAll' => array
  99. (
  100. # 匹配的正则或函数 选填项
  101. 'option' => array
  102. (
  103. 'info_id' => 'yes',
  104. 'state' => 1,
  105. ),
  106. 'type' => 'all',
  107. 'order' => array('num' => 'asc', 'cdate' => 'desc'),
  108. 'col' => '*',
  109. 'call' => 'collection/lib/buy.getInfo',
  110. ),
  111. ),
  112. );