goods.php 5.2 KB

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