store_goods.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'store_goods',
  6. # 显示给用户看的名称
  7. 'lang' => '仓库商品列表',
  8. 'order' => 10,
  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. 'search' => 'order',
  21. 'update' => 'hidden',
  22. //'list' => true,
  23. ),
  24. 'servicer_store_id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => '所属配送商',
  28. 'default' => '',
  29. 'desc' => '所属配送商',
  30. 'match' => 'is_numeric',
  31. 'update' => 'hidden',
  32. 'search' => 'hidden',
  33. 'value' => Dever::input('search_option_servicer_store_id'),
  34. 'list' => 'Dever::load("scm_servicer/store-one#name", {servicer_store_id})',
  35. ),
  36. 'goods-info_sku-code'=> array
  37. (
  38. 'name' => '商品编码',
  39. 'default' => '',
  40. 'desc' => '商品编码',
  41. 'match' => 'option',
  42. # 读取另外表的关联方式
  43. 'sync' => array('sku_id', 'id', 'goods_id', 'info_id', 'key'),
  44. 'list' => true,
  45. 'list_order' => 4,
  46. ),
  47. 'goods_id' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => '商品名称',
  51. 'default' => '',
  52. 'desc' => '商品名称',
  53. 'match' => 'is_numeric',
  54. 'update' => 'select',
  55. 'update_search' => 'scm_product/lib/manage.search',
  56. 'list' => 'Dever::load("scm_product/info-one#name", {goods_id})',
  57. ),
  58. 'sku_id' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '规格型号',
  62. 'default' => '-1',
  63. 'desc' => '规格型号',
  64. 'match' => 'is_numeric',
  65. ),
  66. 'state' => array
  67. (
  68. 'type' => 'tinyint-1',
  69. 'name' => '状态',
  70. 'default' => '1',
  71. 'desc' => '请选择状态',
  72. 'match' => 'is_numeric',
  73. ),
  74. 'cdate' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '创建时间',
  78. 'match' => array('is_numeric', time()),
  79. 'desc' => '',
  80. # 只有insert时才生效
  81. 'insert' => true,
  82. 'search' => 'date',
  83. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  84. ),
  85. ),
  86. 'manage' => array
  87. (
  88. 'insert' => false,
  89. 'edit' => false,
  90. 'delete' => false,
  91. ),
  92. 'request' => array
  93. (
  94. # 后台搜索用到,也可以不加,自动生成
  95. 'search' => array
  96. (
  97. # 匹配的正则或函数 选填项
  98. 'option' => array
  99. (
  100. 'name' => array('yes-t_2.name', 'like'),
  101. 'servicer_store_id' => array('yes-t_1.servicer_store_id'),
  102. 'status' => 'yes-t_2.status-1',
  103. 'state' => 'yes-t_2.state-1',
  104. 'state_1' => 'yes-t_1.state-1',
  105. ),
  106. # 联表
  107. 'join' => array
  108. (
  109. array
  110. (
  111. 'table' => 'scm_product/info',
  112. 'type' => 'left join',
  113. 'on' => array('goods_id','id'),
  114. 'col' => 'goods_id',
  115. ),
  116. ),
  117. 'type' => 'all',
  118. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  119. 'page' => array(10, 'list'),
  120. 'col' => '*, t_2.*,t_2.id as value, "" as selected, "" as disabled',
  121. ),
  122. 'getData' => array
  123. (
  124. # 匹配的正则或函数 选填项
  125. 'option' => array
  126. (
  127. 'servicer_store_id' => array('yes-t_1.servicer_store_id'),
  128. 'sell_type' => array('yes-t_2.sell_type'),
  129. 'name' => array('yes-t_2.name', 'like'),
  130. 'category' => array('yes-t_2.category', 'like'),
  131. 'top_category_id' => array('yes-t_2.top_category_id'),
  132. 'second_category_id' => array('yes-t_2.second_category_id'),
  133. 'category_id' => array('yes-t_2.category_id'),
  134. 'status' => 'yes-t_2.status-1',
  135. 'state' => 'yes-t_2.state-1',
  136. 'state_1' => 'yes-t_1.state-1',
  137. ),
  138. # 联表
  139. 'join' => array
  140. (
  141. array
  142. (
  143. 'table' => 'scm_product/info',
  144. 'type' => 'left join',
  145. 'on' => array('goods_id','id'),
  146. 'col' => 'goods_id',
  147. ),
  148. ),
  149. 'type' => 'all',
  150. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  151. 'col' => 'id,name,category,pic,content,video,type,unit,spec_type,goods,commission,pay_money,money_id,score_id,sell_type,buy_type,udate,cdate',
  152. ),
  153. 'getDataPage' => array
  154. (
  155. # 匹配的正则或函数 选填项
  156. 'option' => array
  157. (
  158. 'servicer_store_id' => array('yes-t_1.servicer_store_id'),
  159. 'sell_type' => array('yes-t_2.sell_type'),
  160. 'name' => array('yes-t_2.name', 'like'),
  161. 'category' => array('yes-t_2.category', 'like'),
  162. 'top_category_id' => array('yes-t_2.top_category_id'),
  163. 'second_category_id' => array('yes-t_2.second_category_id'),
  164. 'category_id' => array('yes-t_2.category_id'),
  165. 'status' => 'yes-t_2.status-1',
  166. 'state' => 'yes-t_2.state-1',
  167. 'state_1' => 'yes-t_1.state-1',
  168. ),
  169. # 联表
  170. 'join' => array
  171. (
  172. array
  173. (
  174. 'table' => 'scm_product/info',
  175. 'type' => 'left join',
  176. 'on' => array('goods_id','id'),
  177. 'col' => 'goods_id',
  178. ),
  179. ),
  180. 'type' => 'all',
  181. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  182. 'page' => array(10, 'list'),
  183. 'col' => 'id,name,category,pic,content,video,type,unit,spec_type,goods,commission,pay_money,money_id,score_id,sell_type,buy_type,udate,t_1.cdate,t_1.id as id',
  184. ),
  185. ),
  186. );