attr.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | attr.php 分类属性关联表
  5. |--------------------------------------------------------------------------
  6. */
  7. $menu = false;
  8. if (Dever::project('attr')) {
  9. $menu = 'category';
  10. }
  11. $attr = function()
  12. {
  13. $auth = Dever::load('attr/api.get', false);
  14. return $auth;
  15. };
  16. return array
  17. (
  18. # 表名
  19. 'name' => 'attr',
  20. # 显示给用户看的名称
  21. 'lang' => '分类属性设置',
  22. 'order' => 100,
  23. 'menu' => $menu,
  24. 'check' => 'category',
  25. # 数据结构
  26. 'struct' => array
  27. (
  28. 'id' => array
  29. (
  30. 'type' => 'int-11',
  31. 'name' => 'ID',
  32. 'default' => '',
  33. 'desc' => '',
  34. 'match' => 'is_numeric',
  35. 'search' => 'order',
  36. //'list' => true,
  37. ),
  38. 'category' => array
  39. (
  40. 'type' => 'varchar-500',
  41. 'name' => '分类',
  42. 'default' => '',
  43. 'desc' => '该分类下已有属性设置',
  44. 'match' => 'is_string',
  45. //'search' => 'linkage',
  46. 'update' => 'linkage',
  47. 'option' => Dever::url('api.get', 'category'),
  48. 'list' => 'Dever::load("category/api.string", "{category}")',
  49. ),
  50. 'attr' => array
  51. (
  52. 'type' => 'varchar-800',
  53. 'name' => '属性设置',
  54. 'default' => '',
  55. 'desc' => '属性设置',
  56. 'match' => 'option',
  57. 'update' => 'checkbox',
  58. 'option' => $attr,
  59. //'update_input' => '',
  60. //'update_input_default' => '',
  61. 'update_parent' => 'checkbox',
  62. 'list' => 'Dever::load("attr/api.string", "{attr}", "{attr_input}")',
  63. ),
  64. 'attr_input' => array
  65. (
  66. 'type' => 'text-255',
  67. 'name' => '属性值设置',
  68. 'default' => '',
  69. 'desc' => '属性值设置',
  70. 'match' => 'option',
  71. ),
  72. 'state' => array
  73. (
  74. 'type' => 'tinyint-1',
  75. 'name' => '状态',
  76. 'default' => '1',
  77. 'desc' => '请选择状态',
  78. 'match' => 'is_numeric',
  79. ),
  80. 'cdate' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '录入时间',
  84. 'match' => array('is_numeric', DEVER_TIME),
  85. 'desc' => '',
  86. # 只有insert时才生效
  87. 'insert' => true,
  88. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  89. ),
  90. ),
  91. 'manage' => array
  92. (
  93. //'delete' => false,
  94. //'edit' => false,
  95. //'insert' => false,
  96. ),
  97. 'request' => array
  98. (
  99. 'getAttr' => array
  100. (
  101. # 匹配的正则或函数 选填项
  102. 'option' => array
  103. (
  104. 'category' => array('yes', 'like'),
  105. ),
  106. 'type' => 'all',
  107. 'order' => array('id' => 'desc'),
  108. 'col' => 'attr,attr_input',
  109. ),
  110. )
  111. );