goods.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'goods',
  6. # 显示给用户看的名称
  7. 'lang' => '商品价格模板',
  8. 'order' => 200,
  9. 'menu' => false,
  10. 'fill' => array
  11. (
  12. # 从哪个表填充
  13. 'goods/info' => array
  14. (
  15. # 条件,另外一个表的字段 => 本表的字段
  16. 'where' => array('id' => 'goods_id'),
  17. # 要填充的数据,另外一个表的字段 => 本表的字段,如果不填写就是所有的
  18. 'update' => array('price_type' => 'price_type', 'status' => 'status'),
  19. # 不需要填充的字段 与update互斥
  20. //'no' => array('id', 'seller_id', 'service_id', 'chose', 'state', 'cdate')
  21. )
  22. ),
  23. # 数据结构 不同的字段放这里
  24. 'struct' => array
  25. (
  26. 'id' => array
  27. (
  28. 'type' => 'int-11',
  29. 'name' => 'ID',
  30. 'default' => '',
  31. 'desc' => '',
  32. 'match' => 'is_numeric',
  33. //'list' => true,
  34. ),
  35. 'name' => array
  36. (
  37. 'type' => 'varchar-800',
  38. 'name' => '模板名称',
  39. 'default' => '',
  40. 'desc' => '模板名称',
  41. 'match' => 'is_string',
  42. 'update' => 'text',
  43. 'search' => 'fulltext',
  44. 'list' => true,
  45. 'edit' => true,
  46. ),
  47. 'goods_id' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => '商品名称',
  51. 'default' => '',
  52. 'desc' => '商品ID',
  53. 'match' => 'is_numeric',
  54. 'update' => 'hidden',
  55. 'value' => Dever::input('search_option_goods_id'),
  56. 'list' => 'Dever::load("goods/info-one#name", {goods_id})',
  57. ),
  58. 'category_id' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '分类id',
  62. 'default' => '',
  63. 'desc' => '分类id',
  64. 'match' => 'is_numeric',
  65. ),
  66. 'price_type' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '价格类型',
  70. 'default' => '0',
  71. 'desc' => '价格类型',
  72. 'match' => 'is_numeric',
  73. 'table' => 'goods/info',
  74. ),
  75. 'price_sell' => array
  76. (
  77. 'type' => 'varchar-100',
  78. 'name' => '销售价',
  79. 'default' => '',
  80. 'desc' => '销售价',
  81. 'match' => 'option',
  82. 'list_name' => '模板价格',
  83. 'list' => 'Dever::load("goods/lib/sku.table", "{goods_id}", "price", "{id}", false, false)',
  84. ),
  85. 'price_buy' => array
  86. (
  87. 'type' => 'varchar-100',
  88. 'name' => '门店采购价',
  89. 'default' => '',
  90. 'desc' => '采购价',
  91. 'match' => 'option',
  92. ),
  93. 'price_num' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '起购数',
  97. 'default' => '1',
  98. 'desc' => '起购数',
  99. 'match' => 'is_string',
  100. ),
  101. 'state' => array
  102. (
  103. 'type' => 'tinyint-1',
  104. 'name' => '数据状态',
  105. 'default' => '1',
  106. 'desc' => '请选择状态',
  107. 'match' => 'is_numeric',
  108. ),
  109. 'cdate' => array
  110. (
  111. 'type' => 'int-11',
  112. 'name' => '发布时间',
  113. 'match' => array('is_numeric', time()),
  114. 'desc' => '',
  115. # 只有insert时才生效
  116. 'insert' => true,
  117. //'search' => 'date',
  118. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  119. ),
  120. ),
  121. 'manage' => array
  122. (
  123. 'edit' => false,
  124. 'insert' => false,
  125. //'delete' => false,
  126. 'button' => array
  127. (
  128. '新增' => array('fast', 1, 'goods'),
  129. ),
  130. # 列表里的按钮
  131. 'list_button' => array
  132. (
  133. 'fast_list' => array('编辑', '"info_sku&project=goods&goods_id={goods_id}&other=price&other_id={id}&page_type=1"', '{price_type} <= 3'),
  134. ),
  135. ),
  136. # request 请求接口定义
  137. 'request' => array
  138. (
  139. ),
  140. );
  141. return $config;