watch.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. $info = function()
  3. {
  4. $array = array();
  5. $info = Dever::load('set/info-state');
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'watch',
  16. # 显示给用户看的名称
  17. 'lang' => '用户听课管理',
  18. 'order' => 40,
  19. # 数据结构
  20. 'struct' => array
  21. (
  22. 'id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => 'ID',
  26. 'default' => '',
  27. 'desc' => '',
  28. 'match' => 'is_numeric',
  29. //'search' => 'order',
  30. //'list' => true,
  31. ),
  32. 'uid' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '用户',
  36. 'default' => '',
  37. 'desc' => '用户ID',
  38. 'match' => 'is_numeric',
  39. 'search' => 'order',
  40. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#name", {uid}) : "匿名用户"',
  41. ),
  42. 'info_id' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '所属小程序',
  46. 'default' => '1',
  47. 'desc' => '请选择所属小程序',
  48. 'match' => 'is_numeric',
  49. 'update' => 'select',
  50. 'option' => $info,
  51. 'search' => 'select',
  52. 'list' => '{info_id} > 0 ? Dever::load("set/info-one#name", {info_id}) : "未知"',
  53. ),
  54. 'course_id' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => '课程标题',
  58. 'default' => '',
  59. 'desc' => '课程标题',
  60. 'match' => 'option',
  61. 'list' => 'Dever::load("content/course-one#name", {course_id})',
  62. ),
  63. 'state' => array
  64. (
  65. 'type' => 'tinyint-1',
  66. 'name' => '状态',
  67. 'default' => '1',
  68. 'desc' => '请选择状态',
  69. 'match' => 'is_numeric',
  70. ),
  71. 'cdate' => array
  72. (
  73. 'type' => 'int-11',
  74. 'name' => '听课时间',
  75. 'match' => array('is_numeric', time()),
  76. 'desc' => '',
  77. # 只有insert时才生效
  78. 'insert' => true,
  79. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  80. ),
  81. ),
  82. 'manage' => array
  83. (
  84. 'insert' => false,
  85. 'edit' => false,
  86. 'delete' => false,
  87. ),
  88. );