goods_sku.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'goods_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. 'factory_id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => '所属工厂',
  26. 'default' => '',
  27. 'desc' => '所属工厂',
  28. 'list' => 'Dever::load("factory/info-find#name", {factory_id})',
  29. ),
  30. 'goods_id' => array
  31. (
  32. 'type' => 'int-11',
  33. 'name' => '商品名称',
  34. 'default' => '',
  35. 'desc' => '商品名称',
  36. 'match' => 'is_numeric',
  37. 'list' => 'Dever::load("goods/info-find#name", {goods_id})',
  38. ),
  39. 'factory_goods_id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => '商品名称',
  43. 'default' => '',
  44. 'desc' => '商品名称',
  45. 'value' => Dever::input('search_option_factory_goods_id'),
  46. 'update' => 'hidden',
  47. 'match' => 'is_numeric',
  48. ),
  49. 'sku_id' => array
  50. (
  51. 'type' => 'int-11',
  52. 'name' => '商品sku',
  53. 'default' => '',
  54. 'desc' => '商品sku',
  55. 'match' => 'is_numeric',
  56. ),
  57. 'c_price' => array
  58. (
  59. 'type' => 'decimal-10,2',
  60. 'name' => '出厂价',
  61. 'default' => '',
  62. 'desc' => '出厂价',
  63. 'match' => 'option',
  64. 'update' => 'text',
  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' => 'desc',
  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. 'manage' => array
  100. (
  101. 'insert' => false,
  102. 'edit' => false,
  103. 'delete' => false,
  104. 'num' => false,
  105. 'page_list_table' => 'sku',
  106. # 自定义快捷新增和编辑
  107. 'button' => array
  108. (
  109. //'自定义属性' => array('fast', 1, 'config&where_id=1'),
  110. ),
  111. ),
  112. # request 请求接口定义
  113. 'request' => array
  114. (
  115. # 列表
  116. 'getData' => array
  117. (
  118. # 匹配的正则或函数 选填项
  119. 'option' => array
  120. (
  121. 'factory_id' => 'yes',
  122. 'sku_id' => 'yes',
  123. 'goods_id' => 'yes',
  124. 'factory_goods_id' => 'yes',
  125. 'state' => 1,
  126. ),
  127. 'type' => 'all',
  128. 'order' => array('id' => 'desc'),
  129. 'col' => '*|sku_id',
  130. ),
  131. 'getMinOne' => array
  132. (
  133. # 匹配的正则或函数 选填项
  134. 'option' => array
  135. (
  136. 'factory_id' => 'yes',
  137. 'sku_id' => 'yes',
  138. 'goods_id' => 'yes',
  139. 'factory_goods_id' => 'yes',
  140. 'state' => 1,
  141. ),
  142. 'type' => 'one',
  143. 'order' => array('price' => 'asc', 'id' => 'desc'),
  144. 'col' => '*',
  145. ),
  146. 'getMaxOne' => array
  147. (
  148. # 匹配的正则或函数 选填项
  149. 'option' => array
  150. (
  151. 'factory_id' => 'yes',
  152. 'sku_id' => 'yes',
  153. 'goods_id' => 'yes',
  154. 'factory_goods_id' => 'yes',
  155. 'state' => 1,
  156. ),
  157. 'type' => 'one',
  158. 'order' => array('price' => 'desc', 'id' => 'desc'),
  159. 'col' => '*',
  160. ),
  161. ),
  162. );
  163. return $config;