info_sku.php 3.6 KB

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