course.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php
  2. $course = function()
  3. {
  4. return Dever::db('course/info')->state();
  5. };
  6. $teacher = function()
  7. {
  8. return Dever::db('teacher/info')->state();
  9. };
  10. $code = function()
  11. {
  12. return Dever::db('code/info')->state();
  13. };
  14. $status = array
  15. (
  16. 1 => '认证中',
  17. 2 => '已认证',
  18. 3 => '认证失败',
  19. );
  20. return array
  21. (
  22. # 表名
  23. 'name' => 'course',
  24. # 显示给用户看的名称
  25. 'lang' => '讲师认证课程',
  26. 'order' => 90,
  27. # 数据结构
  28. 'struct' => array
  29. (
  30. 'id' => array
  31. (
  32. 'type' => 'int-11',
  33. 'name' => 'ID',
  34. 'default' => '',
  35. 'desc' => '',
  36. 'match' => 'is_numeric',
  37. 'list' => true,
  38. ),
  39. 'teacher_id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => '讲师名称',
  43. 'default' => '',
  44. 'desc' => '讲师名称',
  45. 'match' => 'is_numeric',
  46. 'update' => 'select',
  47. 'option' => $teacher,
  48. 'list' => true,
  49. 'search' => 'select',
  50. ),
  51. 'course_id' => array
  52. (
  53. 'type' => 'int-11',
  54. 'name' => '课程名称',
  55. 'default' => '',
  56. 'desc' => '课程名称',
  57. 'match' => 'is_numeric',
  58. 'update' => 'select',
  59. 'option' => $course,
  60. 'list' => true,
  61. 'search' => 'select',
  62. ),
  63. 'code_id' => array
  64. (
  65. 'type' => 'int-11',
  66. 'name' => '认证码',
  67. 'default' => '',
  68. 'desc' => '认证码',
  69. 'match' => 'is_numeric',
  70. 'update' => 'select',
  71. 'option' => $code,
  72. 'list' => true,
  73. ),
  74. 'status' => array
  75. (
  76. 'type' => 'tinyint-11',
  77. 'name' => '认证状态',
  78. 'default' => '',
  79. 'desc' => '认证状态',
  80. 'match' => 'is_numeric',
  81. 'update' => 'radio',
  82. 'option' => $status,
  83. 'search' => 'select',
  84. 'list' => true,
  85. 'edit' => true,
  86. ),
  87. 'state' => array
  88. (
  89. 'type' => 'tinyint-1',
  90. 'name' => '状态',
  91. 'default' => '1',
  92. 'desc' => '请选择状态',
  93. 'match' => 'is_numeric',
  94. ),
  95. 'cdate' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '录入时间',
  99. 'match' => array('is_numeric', time()),
  100. 'desc' => '',
  101. # 只有insert时才生效
  102. 'insert' => true,
  103. ),
  104. ),
  105. # 管理功能
  106. 'manage' => array
  107. (
  108. ),
  109. # request 请求接口定义
  110. 'request' => array
  111. (
  112. ),
  113. );