code.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. $mobile = Dever::rule('mobile');
  3. $status = array
  4. (
  5. 1 => '未使用',
  6. 2 => '已使用',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'code',
  12. # 显示给用户看的名称
  13. 'lang' => '验证码',
  14. 'menu' => false,
  15. # 数据结构
  16. 'struct' => array
  17. (
  18. 'id' => array
  19. (
  20. 'type' => 'int-11',
  21. 'name' => 'ID',
  22. 'default' => '',
  23. 'desc' => '',
  24. 'match' => 'is_numeric',
  25. 'search' => 'order',
  26. //'list' => true,
  27. ),
  28. 'mobile' => array
  29. (
  30. 'type' => 'varchar-32',
  31. 'name' => '手机号',
  32. 'default' => '',
  33. 'desc' => '请输入用户手机号',
  34. 'match' => $mobile,
  35. 'update' => 'text',
  36. 'search' => 'fulltext',
  37. 'list' => true,
  38. ),
  39. 'code' => array
  40. (
  41. 'type' => 'varchar-32',
  42. 'name' => '验证码',
  43. 'default' => '',
  44. 'desc' => '验证码',
  45. 'match' => 'is_string',
  46. 'update' => 'text',
  47. 'search' => 'fulltext',
  48. 'list' => true,
  49. ),
  50. 'day' => array
  51. (
  52. 'type' => 'int-11',
  53. 'name' => '申请天',
  54. 'default' => '',
  55. 'desc' => '申请天',
  56. 'match' => 'is_numeric',
  57. 'update' => 'text',
  58. //'search' => 'fulltext',
  59. //'list' => true,
  60. ),
  61. 'result' => array
  62. (
  63. 'type' => 'text-255',
  64. 'name' => '返回记录',
  65. 'default' => '',
  66. 'desc' => '返回记录',
  67. 'match' => 'is_string',
  68. 'update' => 'text',
  69. 'search' => 'fulltext',
  70. 'list' => 'table',
  71. 'modal' => '查看详情',
  72. ),
  73. 'status' => array
  74. (
  75. 'type' => 'tinyint-1',
  76. 'name' => '状态',
  77. 'default' => '1',
  78. 'desc' => '状态',
  79. 'match' => 'is_string',
  80. //'update' => 'radio',
  81. 'option' => $status,
  82. 'list' => true,
  83. ),
  84. 'state' => array
  85. (
  86. 'type' => 'tinyint-1',
  87. 'name' => '状态',
  88. 'default' => '1',
  89. 'desc' => '请选择状态',
  90. 'match' => 'is_numeric',
  91. ),
  92. 'cdate' => array
  93. (
  94. 'type' => 'int-11',
  95. 'name' => '申请时间',
  96. 'match' => array('is_numeric', time()),
  97. 'desc' => '',
  98. # 只有insert时才生效
  99. 'insert' => true,
  100. 'search' => 'date',
  101. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  102. ),
  103. ),
  104. 'request' => array
  105. (
  106. 'getNew' => array
  107. (
  108. 'option' => array
  109. (
  110. 'status' => 'yes',
  111. 'mobile' => 'yes',
  112. 'state' => 1,
  113. ),
  114. 'type' => 'one',
  115. 'order' => array('id' => 'desc'),
  116. 'col' => '*',
  117. ),
  118. )
  119. );