code.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '发送中',
  6. 2 => '已发送',
  7. );
  8. $mobile = Dever::rule('mobile');
  9. return array
  10. (
  11. # 表名
  12. 'name' => 'code',
  13. # 显示给用户看的名称
  14. 'lang' => '短信记录表',
  15. 'menu' => false,
  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',
  27. //'list' => true,
  28. ),
  29. 'mobile' => array
  30. (
  31. 'type' => 'varchar-32',
  32. 'name' => '手机号',
  33. 'default' => '',
  34. 'desc' => '请输入用户手机号',
  35. 'match' => $mobile,
  36. 'update' => 'text',
  37. 'search' => 'fulltext',
  38. 'list' => true,
  39. ),
  40. 'code' => array
  41. (
  42. 'type' => 'varchar-32',
  43. 'name' => '验证码',
  44. 'default' => '',
  45. 'desc' => '验证码',
  46. 'match' => 'is_string',
  47. 'update' => 'text',
  48. 'search' => 'fulltext',
  49. 'list' => true,
  50. ),
  51. 'day' => array
  52. (
  53. 'type' => 'int-11',
  54. 'name' => '申请时间',
  55. 'default' => '',
  56. 'desc' => '申请时间',
  57. 'match' => 'is_numeric',
  58. 'update' => 'text',
  59. 'search' => 'fulltext',
  60. 'list' => true,
  61. ),
  62. 'state' => array
  63. (
  64. 'type' => 'tinyint-1',
  65. 'name' => '状态',
  66. 'default' => '1',
  67. 'desc' => '请选择状态',
  68. 'match' => 'is_numeric',
  69. 'option' => $option,
  70. //'update' => 'radio',
  71. 'list' => true,
  72. ),
  73. 'cdate' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => '申请时间',
  77. 'match' => array('is_numeric', time()),
  78. 'desc' => '',
  79. # 只有insert时才生效
  80. 'insert' => true,
  81. 'search' => 'date',
  82. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  83. ),
  84. ),
  85. );