info_attr.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'info_attr',
  6. # 显示给用户看的名称
  7. 'lang' => '属性规格',
  8. 'order' => 100,
  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. 'order' => 'asc',
  22. 'update' => 'hidden',
  23. ),
  24. 'info_id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => '商品',
  28. 'default' => '',
  29. 'desc' => '商品',
  30. 'match' => 'is_numeric',
  31. 'update' => 'hidden',
  32. 'value' => Dever::input('search_option_info_id')
  33. ),
  34. 'attr_id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '属性id',
  38. 'default' => '',
  39. 'desc' => '属性id',
  40. 'match' => 'is_numeric',
  41. ),
  42. 'attr_value' => array
  43. (
  44. 'type' => 'varchar-3000',
  45. 'name' => '属性值',
  46. 'default' => '',
  47. 'desc' => '属性值',
  48. 'match' => 'is_string',
  49. ),
  50. 'state' => array
  51. (
  52. 'type' => 'tinyint-1',
  53. 'name' => '状态',
  54. 'default' => '1',
  55. 'desc' => '请选择状态',
  56. 'match' => 'is_numeric',
  57. ),
  58. 'cdate' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '发布时间',
  62. 'match' => array('is_numeric', time()),
  63. 'desc' => '',
  64. # 只有insert时才生效
  65. 'insert' => true,
  66. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  67. ),
  68. ),
  69. # 索引
  70. 'index' => array
  71. (
  72. 1 => array
  73. (
  74. 'search' => 'info_id,attr_id,attr_value',
  75. ),
  76. # 版本号 更改版本号会更新当前表的索引
  77. 'version' => 1,
  78. ),
  79. # 管理功能
  80. 'manage' => array
  81. (
  82. ),
  83. # request 请求接口定义
  84. 'request' => array
  85. (
  86. # 分页
  87. 'getPageAll' => array
  88. (
  89. # 匹配的正则或函数 选填项
  90. 'option' => array
  91. (
  92. 'audit' => array('yes-t_2.audit', 2),
  93. 'category' => array('yes-t_2.category', 'like'),
  94. 'top_category_id' => array('yes-t_2.top_category_id'),
  95. 'second_category_id' => array('yes-t_2.second_category_id'),
  96. 'category_id' => array('yes-t_2.category_id'),
  97. 'state' => array('yes-t_2.state', 1),
  98. ),
  99. # 联表
  100. 'join' => array
  101. (
  102. array
  103. (
  104. 'table' => 'res/info',
  105. 'type' => 'left join',
  106. 'on' => array('info_id','id'),
  107. 'col' => 'info_id',
  108. ),
  109. ),
  110. 'type' => 'all',
  111. 'order' => array('t_1.id' => 'desc'),
  112. 'page' => array(10, 'list'),
  113. 'col' => '*',
  114. ),
  115. 'getDataByInfoId' => array
  116. (
  117. # 匹配的正则或函数 选填项
  118. 'option' => array
  119. (
  120. 'info_id' => 'yes',
  121. 'state' => 1,
  122. ),
  123. 'type' => 'all',
  124. 'order' => array('id' => 'desc'),
  125. 'col' => '*|attr_id',
  126. ),
  127. ),
  128. );
  129. return $config;