chat_user.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'chat_user',
  6. # 显示给用户看的名称
  7. 'lang' => '聊天好友关系',
  8. # 是否显示在后台菜单
  9. 'order' => 20,
  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. 'order' => 'desc',
  22. //'list' => true,
  23. ),
  24. 'uid' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => '用户名',
  28. 'default' => '0',
  29. 'desc' => '请选择用户',
  30. 'match' => 'is_numeric',
  31. 'update' => 'text',
  32. //'search' => 'select',
  33. 'search' => array
  34. (
  35. 'api' => 'passport/user-all',
  36. 'col' => 'username',
  37. 'result' => 'id',
  38. ),
  39. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  40. ),
  41. 'to_uid' => array
  42. (
  43. 'type' => 'int-11',
  44. 'name' => '聊天对象uid',
  45. 'default' => '0',
  46. 'desc' => '聊天对象uid',
  47. 'match' => 'is_numeric',
  48. //'update' => 'text',
  49. ),
  50. 'collection_id' => array
  51. (
  52. 'type' => 'int-11',
  53. 'name' => '合集id',
  54. 'default' => '',
  55. 'desc' => '合集id',
  56. 'match' => 'option',
  57. 'update' => 'text',
  58. ),
  59. 'key' => array
  60. (
  61. 'type' => 'varchar-100',
  62. 'name' => '好友关系key',
  63. 'default' => '',
  64. 'desc' => '好友关系key',
  65. 'match' => 'is_numeric',
  66. //'update' => 'text',
  67. ),
  68. 'state' => array
  69. (
  70. 'type' => 'tinyint-1',
  71. 'name' => '状态',
  72. 'default' => '1',
  73. 'desc' => '请选择状态',
  74. 'match' => 'is_numeric',
  75. ),
  76. 'cdate' => array
  77. (
  78. 'type' => 'int-11',
  79. 'name' => '喜欢时间',
  80. 'match' => array('is_numeric', time()),
  81. 'desc' => '',
  82. # 只有insert时才生效
  83. 'insert' => true,
  84. 'search' => 'date',
  85. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  86. ),
  87. ),
  88. 'manage' => array
  89. (
  90. 'insert' => false,
  91. 'edit' => false,
  92. 'delete' => false,
  93. ),
  94. # request 请求接口定义
  95. 'request' => array
  96. (
  97. 'getAll' => array
  98. (
  99. # 匹配的正则或函数 选填项
  100. 'option' => array
  101. (
  102. 'key' => 'yes',
  103. 'uid' => 'yes',
  104. 'to_uid' => 'yes',
  105. 'collection_id' => 'yes',
  106. 'state' => 1,
  107. ),
  108. 'type' => 'all',
  109. 'order' => array('id' => 'desc'),
  110. 'page' => array(15, 'list'),
  111. 'col' => '*',
  112. ),
  113. )
  114. );