avatar.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. $sex = array
  3. (
  4. -1 => '系统',
  5. 1 => '男',
  6. 2 => '女',
  7. 3 => '中性',
  8. 4 => '全部',
  9. );
  10. return array
  11. (
  12. # 表名
  13. 'name' => 'avatar',
  14. # 显示给用户看的名称
  15. 'lang' => '默认头像',
  16. 'order' => -1,
  17. # 数据结构
  18. 'struct' => array
  19. (
  20. 'id' => array
  21. (
  22. 'type' => 'int-11',
  23. 'name' => 'ID',
  24. 'default' => '',
  25. 'desc' => '',
  26. 'match' => 'is_numeric',
  27. 'search' => 'order,fulltext',
  28. 'list' => true,
  29. ),
  30. 'sex' => array
  31. (
  32. 'type' => 'tinyint-1',
  33. 'name' => '头像性别',
  34. 'default' => '4',
  35. 'desc' => '头像性别',
  36. 'match' => 'is_numeric',
  37. 'option' => $sex,
  38. 'update' => 'radio',
  39. 'list' => true,
  40. ),
  41. //search_exist_avatar=yes
  42. 'avatar' => array
  43. (
  44. 'type' => 'varchar-150',
  45. 'name' => '头像',
  46. 'default' => '',
  47. 'desc' => '请选择头像',
  48. 'match' => 'option',
  49. 'update' => 'image',
  50. 'key' => '1',
  51. 'place' => '150',
  52. 'list' => '"{avatar}" ? "<img src=\'{avatar}\' width=\'150\'>": ""',
  53. //'list' => 'Dever::load("passport/lib/manage.showAvatar", {id})',
  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. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  72. ),
  73. ),
  74. 'manage' => array
  75. (
  76. ),
  77. # request 请求接口定义
  78. 'request' => array
  79. (
  80. # 后台搜索用到
  81. 'rand' => array
  82. (
  83. # 匹配的正则或函数 选填项
  84. 'option' => array
  85. (
  86. 'sex' => array('yes', 'in'),
  87. 'state' => 1,
  88. ),
  89. 'type' => 'one',
  90. 'order' => 'rand()',
  91. 'col' => '*',
  92. ),
  93. ),
  94. );