goods.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'goods',
  6. # 显示给用户看的名称
  7. 'lang' => '商品列表',
  8. 'order' => 10,
  9. 'menu' => false,
  10. 'end' => array
  11. (
  12. 'insert' => 'factory/lib/manage.goodsUpdate',
  13. 'update' => 'factory/lib/manage.goodsUpdate',
  14. ),
  15. 'fill' => array
  16. (
  17. # 从哪个表填充
  18. 'goods/info' => array
  19. (
  20. # 条件,另外一个表的字段 => 本表的字段
  21. 'where' => array('id' => 'goods_id'),
  22. # 要填充的数据,另外一个表的字段 => 本表的字段,如果不填写就是所有的
  23. 'update' => array('price_type'),
  24. # 不需要填充的字段 与update互斥
  25. //'no' => array('id', 'seller_id', 'service_id', 'chose', 'state', 'cdate')
  26. )
  27. ),
  28. # 数据结构
  29. 'struct' => array
  30. (
  31. 'id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => 'ID',
  35. 'default' => '',
  36. 'desc' => '',
  37. 'match' => 'is_numeric',
  38. 'search' => 'order',
  39. 'update' => 'hidden',
  40. //'list' => true,
  41. ),
  42. 'factory_id' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '所属工厂',
  46. 'default' => '',
  47. 'desc' => '所属工厂',
  48. 'match' => 'is_numeric',
  49. 'update' => 'hidden',
  50. 'value' => Dever::input('search_option_factory_id'),
  51. 'list' => 'Dever::load("factory/info-find#name", {factory_id})',
  52. ),
  53. 'goods_id' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '商品名称',
  57. 'default' => '',
  58. 'desc' => '商品名称',
  59. 'match' => 'is_numeric',
  60. 'update' => 'select',
  61. 'update_search' => 'goods/lib/manage.search',
  62. 'list' => 'Dever::load("goods/info-find#name", {goods_id})',
  63. ),
  64. 'category_id' => array
  65. (
  66. 'type' => 'int-11',
  67. 'name' => '分类id',
  68. 'default' => '',
  69. 'desc' => '分类id',
  70. 'match' => 'is_numeric',
  71. ),
  72. 'price_type' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '价格类型',
  76. 'default' => '0',
  77. 'desc' => '价格类型',
  78. 'match' => 'is_numeric',
  79. 'table' => 'goods/info',
  80. ),
  81. 'p_price' => array
  82. (
  83. 'type' => 'decimal-10,2',
  84. 'name' => '出厂价',
  85. 'default' => '0',
  86. 'desc' => '出厂价',
  87. 'match' => 'option',
  88. 'update' => Dever::input('col') ? 'text' : 'hidden',
  89. 'list' => true,
  90. ),
  91. 'state' => array
  92. (
  93. 'type' => 'tinyint-1',
  94. 'name' => '状态',
  95. 'default' => '1',
  96. 'desc' => '请选择状态',
  97. 'match' => 'is_numeric',
  98. ),
  99. 'cdate' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '创建时间',
  103. 'match' => array('is_numeric', time()),
  104. 'desc' => '',
  105. # 只有insert时才生效
  106. //'insert' => true,
  107. 'search' => 'date',
  108. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  109. ),
  110. ),
  111. 'manage' => array
  112. (
  113. 'edit' => false,
  114. # 列表里的按钮
  115. 'list_button' => array
  116. (
  117. //'edit' => array('设置出厂价', 'p_price', '{price_type} == 1'),
  118. 'fast_list' => array('设置出厂价', '"goods_sku&project=factory&search_option_goods_id={goods_id}&search_option_factory_id={factory_id}&oper_parent=goods&oper_project=factory&top_table=info&oper_save_jump=goods&page_type=1"'),
  119. ),
  120. ),
  121. 'request' => array
  122. (
  123. 'getIds' => array
  124. (
  125. # 匹配的正则或函数 选填项
  126. 'option' => array
  127. (
  128. 'factory_id' => 'yes',
  129. 'state' => 1,
  130. ),
  131. 'type' => 'all',
  132. 'order' => array('id' => 'desc'),
  133. 'col' => '*|goods_id',
  134. ),
  135. ),
  136. );