info_spec_value.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?php
  2. $option = array
  3. (
  4. 1 => '选中',
  5. 2 => '未选中',
  6. );
  7. $config = array
  8. (
  9. # 表名
  10. 'name' => 'info_spec_value',
  11. # 显示给用户看的名称
  12. 'lang' => '商品规格值设置',
  13. 'order' => 200,
  14. 'menu' => false,
  15. # 数据结构 不同的字段放这里
  16. 'struct' => array
  17. (
  18. 'id' => array
  19. (
  20. 'type' => 'int-11',
  21. 'name' => 'ID',
  22. 'default' => '',
  23. 'desc' => '',
  24. 'match' => 'is_numeric',
  25. //'list' => true,
  26. ),
  27. 'info_id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => '商品ID',
  31. 'default' => '',
  32. 'desc' => '商品ID',
  33. 'match' => 'is_numeric',
  34. 'update' => 'text',
  35. 'list' => true,
  36. ),
  37. 'spec_id' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => '规格ID',
  41. 'default' => '',
  42. 'desc' => '规格ID',
  43. 'match' => 'is_numeric',
  44. 'update' => 'text',
  45. 'list' => true,
  46. ),
  47. 'value' => array
  48. (
  49. 'type' => 'varchar-500',
  50. 'name' => '规格值',
  51. 'default' => '',
  52. 'desc' => '规格值',
  53. 'match' => 'is_string',
  54. 'update' => 'text',
  55. ),
  56. 'is_checked' => array
  57. (
  58. 'type' => 'tinyint-1',
  59. 'name' => '是否选中',
  60. 'default' => '1',
  61. 'desc' => '是否选中',
  62. 'match' => 'is_numeric',
  63. 'update' => 'radio',
  64. 'option' => $option,
  65. ),
  66. 'reorder' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '排序-数值越小越靠前',
  70. 'default' => '1',
  71. 'desc' => '请输入排序',
  72. 'match' => 'option',
  73. //'update' => 'text',
  74. 'search' => 'order',
  75. 'list' => true,
  76. 'order' => 'asc',
  77. 'edit' => true,
  78. ),
  79. 'state' => array
  80. (
  81. 'type' => 'tinyint-1',
  82. 'name' => '数据状态',
  83. 'default' => '1',
  84. 'desc' => '请选择状态',
  85. 'match' => 'is_numeric',
  86. ),
  87. 'cdate' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '发布时间',
  91. 'match' => array('is_numeric', time()),
  92. 'desc' => '',
  93. # 只有insert时才生效
  94. 'insert' => true,
  95. //'search' => 'date',
  96. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  97. ),
  98. ),
  99. 'index' => array
  100. (
  101. 1 => array
  102. (
  103. # 索引名 => 索引id 如果有后缀.unique,则为建立索引的类型,如id,state.unique
  104. 'info' => 'info_id',
  105. ),
  106. # 版本号 更改版本号会更新当前表的索引
  107. 'version' => 1,
  108. ),
  109. 'manage' => array
  110. (
  111. 'insert' => false,
  112. 'edit' => false,
  113. 'delete' => false,
  114. 'num' => false,
  115. # 自定义快捷新增和编辑
  116. 'button' => array
  117. (
  118. //'自定义属性' => array('fast', 1, 'config&where_id=1'),
  119. ),
  120. ),
  121. # request 请求接口定义
  122. 'request' => array
  123. (
  124. # 列表
  125. 'getAll' => array
  126. (
  127. # 匹配的正则或函数 选填项
  128. 'option' => array
  129. (
  130. 'info_id' => 'yes',
  131. 'spec_id' => 'yes',
  132. 'state' => 1,
  133. ),
  134. 'type' => 'all',
  135. 'order' => array('reorder' => 'asc', 'id' => 'asc'),
  136. 'col' => 'id, value as title, case is_checked when 1 then true else false end as checked',
  137. ),
  138. 'getGroupData' => array
  139. (
  140. # 匹配的正则或函数 选填项
  141. 'option' => array
  142. (
  143. 'info_id' => 'yes',
  144. 'ids' => array('yes-id', 'in'),
  145. 'state' => 1,
  146. ),
  147. 'type' => 'one',
  148. 'group' => 'info_id',
  149. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  150. 'col' => 'id,info_id,value,group_concat(value) as name',
  151. ),
  152. 'getData' => array
  153. (
  154. # 匹配的正则或函数 选填项
  155. 'option' => array
  156. (
  157. 'info_id' => 'yes',
  158. 'spec_id' => 'yes',
  159. 'state' => 1,
  160. ),
  161. 'type' => 'all',
  162. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  163. 'col' => 'id,value as name',
  164. ),
  165. ),
  166. );
  167. return $config;