supply.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <?php
  2. $attr = function()
  3. {
  4. $auth = Dever::load('attr/api.get', false);
  5. return $auth;
  6. };
  7. return array
  8. (
  9. # 表名
  10. 'name' => 'supply',
  11. # 显示给用户看的名称
  12. 'lang' => '供应管理',
  13. # 是否显示在后台菜单
  14. 'order' => 100,
  15. # 同步更新另外一个或多个表的数据
  16. 'sync' => array
  17. (
  18. 'sad/supply_area' => array
  19. (
  20. # 更新另外一个表的字段 => 本表的字段
  21. 'where' => array('supply_id', 'id'),
  22. # 要更新的数据
  23. 'update' => array('area_id' => 'area'),
  24. # 同步更新的类型,delete为先删再插入,update为直接更新
  25. 'type' => 'delete',
  26. ),
  27. 'sad/supply_category' => array
  28. (
  29. 'where' => array('supply_id', 'id'),
  30. 'update' => array('category_id' => 'category'),
  31. 'type' => 'delete',
  32. )
  33. ),
  34. # 数据结构
  35. 'struct' => array
  36. (
  37. 'id' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => 'ID',
  41. 'default' => '',
  42. 'desc' => '',
  43. 'match' => 'is_numeric',
  44. 'order' => 'asc',
  45. 'list' => true,
  46. ),
  47. 'name' => array
  48. (
  49. 'type' => 'varchar-150',
  50. 'name' => '标题',
  51. 'default' => '',
  52. 'desc' => '标题',
  53. 'match' => 'is_string',
  54. 'update' => 'text',
  55. 'search' => 'fulltext',
  56. 'list' => true,
  57. ),
  58. 'area' => array
  59. (
  60. 'type' => 'varchar-100',
  61. 'name' => '地区',
  62. 'default' => '',
  63. 'desc' => '地区',
  64. 'match' => 'is_string',
  65. 'search' => 'linkage',
  66. 'update' => 'linkage',//多级联动 option参数:请求地址(参数为level_num当前联动级数,level_id当前选择的id)
  67. 'option' => Dever::url('api.get', 'area'),
  68. 'list' => 'Dever::load("area/api.string", "{area}")',
  69. ),
  70. 'category' => array
  71. (
  72. 'type' => 'varchar-500',
  73. 'name' => '分类',
  74. 'default' => '',
  75. 'desc' => '分类',
  76. 'match' => 'is_string',
  77. 'search' => 'linkage',
  78. 'update' => 'linkage',
  79. 'option' => Dever::url('api.get', 'category'),
  80. 'list' => 'Dever::load("category/api.string", "{category}")',
  81. ),
  82. 'attr' => array
  83. (
  84. 'type' => 'varchar-800',
  85. 'name' => '属性设置',
  86. 'default' => '',
  87. 'desc' => '属性设置',
  88. 'match' => 'option',
  89. 'update' => 'checkbox',
  90. 'option' => $attr,
  91. 'update_input' => '',
  92. 'update_input_default' => '',
  93. 'update_parent' => 'checkbox',
  94. ),
  95. 'attr_input' => array
  96. (
  97. 'type' => 'text-255',
  98. 'name' => '属性值设置',
  99. 'default' => '',
  100. 'desc' => '属性值设置',
  101. 'match' => 'option',
  102. ),
  103. 'reorder' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '排序(数值越大越靠前)',
  107. 'default' => '1',
  108. 'desc' => '请输入排序',
  109. 'match' => 'option',
  110. 'update' => 'text',
  111. 'search' => 'order',
  112. 'list_name' => '排序',
  113. 'list' => true,
  114. 'order' => 'desc',
  115. 'edit' => true,
  116. ),
  117. 'state' => array
  118. (
  119. 'type' => 'tinyint-1',
  120. 'name' => '状态',
  121. 'default' => '1',
  122. 'desc' => '请选择状态',
  123. 'match' => 'is_numeric',
  124. ),
  125. 'cdate' => array
  126. (
  127. 'type' => 'int-11',
  128. 'name' => '录入时间',
  129. 'match' => array('is_numeric', time()),
  130. 'desc' => '',
  131. # 只有insert时才生效
  132. 'insert' => true,
  133. 'search' => 'date',
  134. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  135. ),
  136. ),
  137. 'manage' => array
  138. (
  139. ),
  140. );