supplier_goods.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?php
  2. $status = Dever::config('base')->status;
  3. return array
  4. (
  5. # 表名
  6. 'name' => 'supplier_goods',
  7. # 显示给用户看的名称
  8. 'lang' => '供应商商品列表',
  9. 'order' => 10,
  10. 'menu' => false,
  11. /*
  12. 'end' => array
  13. (
  14. 'insert' => 'role/lib/seller.goodsUpdate',
  15. 'update' => '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("role/supplier-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' => 'product/lib/manage.search',
  53. 'list' => 'Dever::load("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. 'getData' => array
  84. (
  85. # 匹配的正则或函数 选填项
  86. 'option' => array
  87. (
  88. 'supplier_id' => array('yes-t_1.supplier_id'),
  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' => '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' => '*,t_2.*',
  112. ),
  113. 'getDataPage' => array
  114. (
  115. # 匹配的正则或函数 选填项
  116. 'option' => array
  117. (
  118. 'supplier_id' => array('yes-t_1.supplier_id'),
  119. 'name' => array('yes-t_2.name', 'like'),
  120. 'category' => array('yes-t_2.category', 'like'),
  121. 'top_category_id' => array('yes-t_2.top_category_id'),
  122. 'second_category_id' => array('yes-t_2.second_category_id'),
  123. 'category_id' => array('yes-t_2.category_id'),
  124. 'status' => 'yes-t_2.status-1',
  125. 'state' => 'yes-t_2.state-1',
  126. 'state_1' => 'yes-t_1.state-1',
  127. ),
  128. # 联表
  129. 'join' => array
  130. (
  131. array
  132. (
  133. 'table' => 'product/info',
  134. 'type' => 'left join',
  135. 'on' => array('goods_id','id'),
  136. 'col' => 'goods_id',
  137. ),
  138. ),
  139. 'type' => 'all',
  140. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  141. 'page' => array(10, 'list'),
  142. 'col' => '*,t_2.*',
  143. ),
  144. ),
  145. );