info_spec.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. $col = 'id,info_id,`key`,price,s_price,code';
  3. $config = array
  4. (
  5. # 表名
  6. 'name' => 'info_spec',
  7. # 显示给用户看的名称
  8. 'lang' => '商品规格设置',
  9. 'order' => 200,
  10. 'menu' => false,
  11. # 数据结构 不同的字段放这里
  12. 'struct' => array
  13. (
  14. 'id' => array
  15. (
  16. 'type' => 'int-11',
  17. 'name' => 'ID',
  18. 'default' => '',
  19. 'desc' => '',
  20. 'match' => 'is_numeric',
  21. //'list' => true,
  22. ),
  23. 'info_id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => '商品ID',
  27. 'default' => '',
  28. 'desc' => '商品ID',
  29. 'match' => 'is_numeric',
  30. 'update' => 'text',
  31. 'list' => true,
  32. ),
  33. 'name' => array
  34. (
  35. 'type' => 'varchar-100',
  36. 'name' => '规格名称',
  37. 'default' => '',
  38. 'desc' => '规格名称',
  39. 'match' => 'is_string',
  40. 'update' => 'text',
  41. ),
  42. 'reorder' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '排序-数值越小越靠前',
  46. 'default' => '1',
  47. 'desc' => '请输入排序',
  48. 'match' => 'option',
  49. //'update' => 'text',
  50. 'search' => 'order',
  51. 'list' => true,
  52. 'order' => 'asc',
  53. 'edit' => true,
  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. 'index' => array
  76. (
  77. 1 => array
  78. (
  79. # 索引名 => 索引id 如果有后缀.unique,则为建立索引的类型,如id,state.unique
  80. 'info' => 'info_id',
  81. ),
  82. # 版本号 更改版本号会更新当前表的索引
  83. 'version' => 1,
  84. ),
  85. 'manage' => array
  86. (
  87. 'insert' => false,
  88. 'edit' => false,
  89. 'delete' => false,
  90. 'num' => false,
  91. # 自定义快捷新增和编辑
  92. 'button' => array
  93. (
  94. //'自定义属性' => array('fast', 1, 'config&where_id=1'),
  95. ),
  96. ),
  97. # request 请求接口定义
  98. 'request' => array
  99. (
  100. # 列表
  101. 'getAll' => array
  102. (
  103. # 匹配的正则或函数 选填项
  104. 'option' => array
  105. (
  106. 'info_id' => 'yes',
  107. 'state' => 1,
  108. ),
  109. 'type' => 'all',
  110. 'order' => array('reorder' => 'asc', 'id' => 'asc'),
  111. 'col' => 'id, name as title',
  112. ),
  113. # 列表
  114. 'getData' => array
  115. (
  116. # 匹配的正则或函数 选填项
  117. 'option' => array
  118. (
  119. 'info_id' => 'yes',
  120. 'state' => 1,
  121. ),
  122. 'type' => 'all',
  123. 'order' => array('reorder' => 'asc', 'id' => 'asc'),
  124. 'col' => 'id, name',
  125. ),
  126. ),
  127. );
  128. return $config;