info_attr.php 3.1 KB

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