product.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. $status = Dever::config('base')->status;
  3. $text = array
  4. (
  5. 1 => '上左',
  6. 2 => '上中',
  7. 3 => '上右',
  8. 4 => '中左',
  9. 5 => '正中',
  10. 6 => '中右',
  11. 7 => '下左',
  12. 8 => '下中',
  13. 9 => '下右',
  14. //10 => '自定义',
  15. );
  16. $bgcolor_type = array
  17. (
  18. 1 => '设置背景颜色',
  19. 2 => '不设置背景颜色',
  20. );
  21. return array
  22. (
  23. # 表名
  24. 'name' => 'product',
  25. # 显示给用户看的名称
  26. 'lang' => '电商产品',
  27. 'order' => 100,
  28. 'menu' => false,
  29. 'end' => array
  30. (
  31. 'insert' => 'collection/lib/content.updateTypeId',
  32. 'update' => 'collection/lib/content.updateTypeId',
  33. ),
  34. # 数据结构
  35. 'struct' => array
  36. (
  37. 'id' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => 'ID',
  41. 'default' => '',
  42. 'desc' => '',
  43. 'match' => 'is_numeric',
  44. 'list' => true,
  45. ),
  46. 'info_id' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => '合集',
  50. 'default' => '',
  51. 'desc' => '合集',
  52. 'match' => 'is_numeric',
  53. 'update' => 'hidden',
  54. 'value' => Dever::input('search_option_info_id')
  55. ),
  56. 'content_id' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '合集内容id',
  60. 'default' => '',
  61. 'desc' => '合集内容id',
  62. 'match' => 'is_numeric',
  63. 'update' => 'hidden',
  64. 'value' => Dever::input('search_option_content_id')
  65. ),
  66. 'goods_id' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '选择商品',
  70. 'default' => '',
  71. 'desc' => '选择商品',
  72. 'match' => 'option',
  73. 'update' => 'select',
  74. 'show' => 'type=11',
  75. 'update_search' => 'goods/lib/manage.search',
  76. ),
  77. 'status' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '发布状态',
  81. 'default' => '1',
  82. 'desc' => '发布状态',
  83. 'match' => 'is_numeric',
  84. //'update' => 'select',
  85. 'option' => $status,
  86. 'search' => 'select',
  87. //'list' => true,
  88. //'edit' => true,
  89. ),
  90. 'reorder' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '排序(数值越大越靠前)',
  94. 'default' => '1',
  95. 'desc' => '请输入排序',
  96. 'match' => 'option',
  97. //'update' => 'text',
  98. 'search' => 'order',
  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. ),
  120. ),
  121. # 管理功能
  122. 'manage' => array
  123. (
  124. ),
  125. # request 请求接口定义
  126. 'request' => array
  127. (
  128. 'getAll' => array
  129. (
  130. # 匹配的正则或函数 选填项
  131. 'option' => array
  132. (
  133. 'info_id' => 'yes',
  134. 'content_id' => 'yes',
  135. 'state' => 1,
  136. ),
  137. 'type' => 'all',
  138. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  139. 'col' => '*',
  140. ),
  141. ),
  142. );