info_sku.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'info_sku',
  6. # 显示给用户看的名称
  7. 'lang' => '商品SKU设置',
  8. 'order' => 200,
  9. 'menu' => false,
  10. //'check' => 'code',
  11. # 数据结构 不同的字段放这里
  12. 'struct' => array
  13. (
  14. 'id' => array
  15. (
  16. 'type' => 'int-11',
  17. 'name' => 'ID',
  18. 'default' => '',
  19. 'desc' => '',
  20. 'match' => 'is_numeric',
  21. //'list' => true,
  22. ),
  23. 'info_id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => '商品ID',
  27. 'default' => '',
  28. 'desc' => '商品ID',
  29. 'match' => 'is_numeric',
  30. 'update' => 'text',
  31. 'list' => true,
  32. ),
  33. 'key' => array
  34. (
  35. 'type' => 'varchar-500',
  36. 'name' => '规格id',
  37. 'default' => '',
  38. 'desc' => '规格id',
  39. 'match' => 'is_string',
  40. 'update' => 'text',
  41. ),
  42. 'code' => array
  43. (
  44. 'type' => 'varchar-100',
  45. 'name' => '商品条码',
  46. 'default' => '',
  47. 'desc' => '商品条码',
  48. 'match' => 'is_string',
  49. 'update' => 'text',
  50. 'search' => 'fulltext',
  51. 'list' => true,
  52. ),
  53. 'pic' => array
  54. (
  55. 'type' => 'varchar-150',
  56. 'name' => '商品图',
  57. 'default' => '',
  58. 'desc' => '商品图',
  59. 'match' => 'option',
  60. 'update' => 'text',
  61. 'list' => true,
  62. ),
  63. 'price' => array
  64. (
  65. 'type' => 'varchar-100',
  66. 'name' => '销售价',
  67. 'default' => '',
  68. 'desc' => '销售价',
  69. 'match' => 'option',
  70. 'update' => 'text',
  71. 'list' => true,
  72. ),
  73. 'un_price' => array
  74. (
  75. 'type' => 'varchar-100',
  76. 'name' => '划线价',
  77. 'default' => '',
  78. 'desc' => '划线价',
  79. 'match' => 'option',
  80. 'update' => 'text',
  81. 'list' => true,
  82. ),
  83. 'buy_price' => array
  84. (
  85. 'type' => 'varchar-100',
  86. 'name' => '采购价',
  87. 'default' => '',
  88. 'desc' => '采购价',
  89. 'match' => 'option',
  90. 'update' => 'text',
  91. 'list' => true,
  92. ),
  93. 'cost_price' => array
  94. (
  95. 'type' => 'varchar-100',
  96. 'name' => '成本价',
  97. 'default' => '',
  98. 'desc' => '成本价',
  99. 'match' => 'option',
  100. 'update' => 'text',
  101. //'list' => 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. //'search' => 'date',
  120. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  121. ),
  122. ),
  123. 'index' => array
  124. (
  125. 1 => array
  126. (
  127. # 索引名 => 索引id 如果有后缀.unique,则为建立索引的类型,如id,state.unique
  128. 'info' => 'info_id,`key`',
  129. ),
  130. # 版本号 更改版本号会更新当前表的索引
  131. 'version' => 1,
  132. ),
  133. 'manage' => array
  134. (
  135. 'insert' => false,
  136. 'edit' => false,
  137. 'delete' => false,
  138. 'num' => false,
  139. //'page_list_table' => 'sku',
  140. # 自定义快捷新增和编辑
  141. 'button' => array
  142. (
  143. //'自定义属性' => array('fast', 1, 'config&where_id=1'),
  144. ),
  145. ),
  146. # request 请求接口定义
  147. 'request' => array
  148. (
  149. # 后台搜索用到 也可以不加,自动生成
  150. 'search' => array
  151. (
  152. # 匹配的正则或函数 选填项
  153. 'option' => array
  154. (
  155. 'ids' => array('yes-id', 'in'),
  156. 'info_id' => 'yes',
  157. 'id' => 'yes',
  158. 'state' => 1,
  159. ),
  160. 'type' => 'all',
  161. 'order' => array('id' => 'desc'),
  162. 'limit' => '0,10',
  163. 'col' => 'key as name, id, id as value, "" as selected, "" as disabled|id',
  164. ),
  165. # 列表
  166. 'getAll' => array
  167. (
  168. # 匹配的正则或函数 选填项
  169. 'option' => array
  170. (
  171. 'id' => 'yes',
  172. 'info_id' => 'yes',
  173. 'state' => 1,
  174. ),
  175. 'type' => 'all',
  176. 'order' => array('id' => 'desc'),
  177. 'col' => '*|key',
  178. ),
  179. # 列表
  180. 'getData' => array
  181. (
  182. # 匹配的正则或函数 选填项
  183. 'option' => array
  184. (
  185. 'id' => 'yes',
  186. 'info_id' => 'yes',
  187. 'state' => 1,
  188. ),
  189. 'type' => 'all',
  190. 'order' => array('id' => 'desc'),
  191. 'col' => 'id,`key`,code,pic,price,un_price,buy_price,cost_price|key',
  192. ),
  193. ),
  194. );
  195. return $config;