TeachingKnowledge.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkAdmin
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: https://thinkadmin.top
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // | 免费声明 ( https://thinkadmin.top/disclaimer )
  11. // +----------------------------------------------------------------------
  12. // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
  13. // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
  14. // +----------------------------------------------------------------------
  15. namespace app\admin\controller;
  16. use app\data\model\DataPoolTalent;
  17. use app\data\model\DataTeachingKnowledge;
  18. use app\data\model\DataZhicheng;
  19. use Carbon\Carbon;
  20. use think\admin\Controller;
  21. use app\data\model\SystemUser;
  22. use think\Db;
  23. use think\db\Query;
  24. /**
  25. * 知识教学管理
  26. * Class PoolTalent
  27. * @package app\admin\controller
  28. */
  29. class TeachingKnowledge extends Controller
  30. {
  31. /**
  32. * 知识教学申请管理
  33. * @auth true
  34. * @menu true
  35. */
  36. public function index(){
  37. $this->title='知识教学列表';
  38. $name=input('name');
  39. DataTeachingKnowledge::mQuery()
  40. ->when($name,function (Query $query) use ($name) {
  41. $query->hasWhere('user',function (Query $query) use ($name) {
  42. $query->whereLike('nickname',"%{$name}%");
  43. });
  44. })
  45. ->like('title')
  46. ->with(['user'])
  47. ->where('type',1)
  48. ->where('is_del',1)
  49. ->order('id','desc')
  50. ->layTable();
  51. }
  52. protected function _index_page_filter(&$data)
  53. {
  54. }
  55. /**
  56. * 知识教学添加
  57. * @auth true
  58. * @menu true
  59. */
  60. public function add(){
  61. DataTeachingKnowledge::mForm('form');
  62. }
  63. /**
  64. * 知识教学编辑
  65. * @auth true
  66. * @menu true
  67. */
  68. public function edit(){
  69. DataTeachingKnowledge::mForm('form');
  70. }
  71. public function _form_filter($vo){
  72. if ($this->request->isGet()) {
  73. if (isset($vo['id'])){
  74. if (isset($vo['imgs'])){
  75. //$vo['imgs']= implode('|',explode(',',implode(',',$vo['imgs'])));
  76. }
  77. $this->assign('vo',$vo);
  78. $this->fetch('form');
  79. }
  80. }elseif ($this->request->isPost()){
  81. }
  82. }
  83. /**
  84. * 删除
  85. * @auth true
  86. * @menu true
  87. */
  88. public function del($id){
  89. DataTeachingKnowledge::whereIn('id',$id)->save([
  90. 'is_del'=>0,
  91. ]);
  92. $this->success('删除成功');
  93. }
  94. /**
  95. * 知识教学设置
  96. * @auth true
  97. * @menu true
  98. */
  99. public function setting(){
  100. $this->title='系统设置';
  101. if($this->request->isGet()){
  102. $config=systemConfig('teaching_config');
  103. $this->assign('config',$config);
  104. $this->fetch();
  105. }else{
  106. $data=$this->request->post();
  107. systemConfig('teaching_config',$data);
  108. $this->success('保存成功');
  109. }
  110. }
  111. }