avatar.php 2.5 KB

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