goods.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <?php
  2. $status = Dever::config('base')->status;
  3. return array
  4. (
  5. # 表名
  6. 'name' => 'goods',
  7. # 显示给用户看的名称
  8. 'lang' => '供应商商品列表',
  9. 'order' => 10,
  10. 'menu' => false,
  11. /*
  12. 'end' => array
  13. (
  14. 'insert' => 'scm_role/lib/seller.goodsUpdate',
  15. 'update' => 'scm_role/lib/seller.goodsUpdate',
  16. ),
  17. */
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => 'ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. 'search' => 'order',
  29. 'update' => 'hidden',
  30. //'list' => true,
  31. ),
  32. 'supplier_id' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '所属供应商',
  36. 'default' => '',
  37. 'desc' => '所属供应商',
  38. 'match' => 'is_numeric',
  39. 'update' => 'hidden',
  40. 'search' => 'hidden',
  41. 'value' => Dever::input('search_option_supplier_id'),
  42. 'list' => 'Dever::load("scm_supplier/info-one#name", {supplier_id})',
  43. ),
  44. 'goods_id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '商品名称',
  48. 'default' => '',
  49. 'desc' => '商品名称',
  50. 'match' => 'is_numeric',
  51. 'update' => 'select',
  52. 'update_search' => 'scm_product/lib/manage.search',
  53. 'list' => 'Dever::load("scm_product/info-one#name", {goods_id})',
  54. ),
  55. 'state' => array
  56. (
  57. 'type' => 'tinyint-1',
  58. 'name' => '状态',
  59. 'default' => '1',
  60. 'desc' => '请选择状态',
  61. 'match' => 'is_numeric',
  62. ),
  63. 'cdate' => array
  64. (
  65. 'type' => 'int-11',
  66. 'name' => '创建时间',
  67. 'match' => array('is_numeric', time()),
  68. 'desc' => '',
  69. # 只有insert时才生效
  70. //'insert' => true,
  71. //'search' => 'date',
  72. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  73. ),
  74. ),
  75. 'manage' => array
  76. (
  77. 'insert' => false,
  78. 'edit' => false,
  79. 'delete' => false,
  80. ),
  81. 'request' => array
  82. (
  83. # 后台搜索用到,也可以不加,自动生成
  84. 'search' => array
  85. (
  86. # 匹配的正则或函数 选填项
  87. 'option' => array
  88. (
  89. 'supplier_id' => array('yes-t_1.supplier_id'),
  90. 'status' => 'yes-t_2.status-1',
  91. 'state' => 'yes-t_2.state-1',
  92. 'state_1' => 'yes-t_1.state-1',
  93. ),
  94. # 联表
  95. 'join' => array
  96. (
  97. array
  98. (
  99. 'table' => 'scm_product/info',
  100. 'type' => 'left join',
  101. 'on' => array('goods_id','id'),
  102. 'col' => 'goods_id',
  103. ),
  104. ),
  105. 'type' => 'all',
  106. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  107. 'col' => '*,t_2.*,t_2.id as value, "" as selected, "" as disabled',
  108. ),
  109. 'getData' => array
  110. (
  111. # 匹配的正则或函数 选填项
  112. 'option' => array
  113. (
  114. 'supplier_id' => array('yes-t_1.supplier_id'),
  115. 'name' => array('yes-t_2.name', 'like'),
  116. 'category' => array('yes-t_2.category', 'like'),
  117. 'top_category_id' => array('yes-t_2.top_category_id'),
  118. 'second_category_id' => array('yes-t_2.second_category_id'),
  119. 'category_id' => array('yes-t_2.category_id'),
  120. 'status' => 'yes-t_2.status-1',
  121. 'state' => 'yes-t_2.state-1',
  122. 'state_1' => 'yes-t_1.state-1',
  123. ),
  124. # 联表
  125. 'join' => array
  126. (
  127. array
  128. (
  129. 'table' => 'scm_product/info',
  130. 'type' => 'left join',
  131. 'on' => array('goods_id','id'),
  132. 'col' => 'goods_id',
  133. ),
  134. ),
  135. 'type' => 'all',
  136. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  137. 'col' => '*,t_2.*',
  138. ),
  139. 'getDataPage' => array
  140. (
  141. # 匹配的正则或函数 选填项
  142. 'option' => array
  143. (
  144. 'supplier_id' => array('yes-t_1.supplier_id'),
  145. 'name' => array('yes-t_2.name', 'like'),
  146. 'category' => array('yes-t_2.category', 'like'),
  147. 'top_category_id' => array('yes-t_2.top_category_id'),
  148. 'second_category_id' => array('yes-t_2.second_category_id'),
  149. 'category_id' => array('yes-t_2.category_id'),
  150. 'status' => 'yes-t_2.status-1',
  151. 'state' => 'yes-t_2.state-1',
  152. 'state_1' => 'yes-t_1.state-1',
  153. ),
  154. # 联表
  155. 'join' => array
  156. (
  157. array
  158. (
  159. 'table' => 'scm_product/info',
  160. 'type' => 'left join',
  161. 'on' => array('goods_id','id'),
  162. 'col' => 'goods_id',
  163. ),
  164. ),
  165. 'type' => 'all',
  166. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  167. 'page' => array(10, 'list'),
  168. 'col' => '*,t_2.*',
  169. ),
  170. ),
  171. );