user_project.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. $project = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('user/project')->state();
  6. if ($info) {
  7. $array += $info;
  8. }
  9. return $array;
  10. };
  11. return array
  12. (
  13. # 表名
  14. 'name' => 'user_project',
  15. # 显示给用户看的名称
  16. 'lang' => '用户与项目关联表',
  17. 'order' => 10,
  18. 'menu' => false,
  19. # 数据结构
  20. 'struct' => array
  21. (
  22. 'id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => '用户ID',
  26. 'default' => '',
  27. 'desc' => '',
  28. 'match' => 'is_numeric',
  29. 'search' => 'order,fulltext',
  30. 'list' => true,
  31. ),
  32. 'uid' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '用户名',
  36. 'default' => '0',
  37. 'desc' => '请选择用户',
  38. 'match' => 'is_numeric',
  39. 'update' => 'text',
  40. //'search' => 'select',
  41. 'search' => array
  42. (
  43. 'api' => 'user/info-like',
  44. 'col' => 'search',
  45. 'result' => 'id',
  46. ),
  47. 'list' => 'Dever::load("user/lib/info.get#name", {uid})',
  48. ),
  49. 'project_id' => array
  50. (
  51. 'type' => 'int-11',
  52. 'name' => '所属项目',
  53. 'default' => '1',
  54. 'desc' => '所属项目',
  55. 'match' => 'is_numeric',
  56. 'option' => $project,
  57. //'update' => 'select',
  58. //'list' => true,
  59. ),
  60. 'state' => array
  61. (
  62. 'type' => 'tinyint-1',
  63. 'name' => '状态',
  64. 'default' => '1',
  65. 'desc' => '请选择状态',
  66. 'match' => 'is_numeric',
  67. ),
  68. 'cdate' => array
  69. (
  70. 'type' => 'int-11',
  71. 'name' => '创建时间',
  72. 'match' => array('is_numeric', time()),
  73. 'desc' => '',
  74. # 只有insert时才生效
  75. 'insert' => true,
  76. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  77. ),
  78. ),
  79. );