TeachingKnowledge.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. ->where('audit',2)
  50. ->order('id','desc')
  51. ->layTable();
  52. }
  53. protected function _index_page_filter(&$data)
  54. {
  55. }
  56. /**
  57. * 知识教学添加
  58. * @auth true
  59. * @menu true
  60. */
  61. public function add(){
  62. DataTeachingKnowledge::mForm('form');
  63. }
  64. /**
  65. * 知识教学编辑
  66. * @auth true
  67. * @menu true
  68. */
  69. public function edit(){
  70. DataTeachingKnowledge::mForm('form');
  71. }
  72. public function _form_filter($vo){
  73. if ($this->request->isGet()) {
  74. if (isset($vo['id'])){
  75. if (isset($vo['imgs'])){
  76. //$vo['imgs']= implode('|',explode(',',implode(',',$vo['imgs'])));
  77. }
  78. $this->assign('vo',$vo);
  79. $this->fetch('form');
  80. }
  81. }elseif ($this->request->isPost()){
  82. }
  83. }
  84. /**
  85. * 删除
  86. * @auth true
  87. * @menu true
  88. */
  89. public function del($id){
  90. DataTeachingKnowledge::whereIn('id',$id)->save([
  91. 'is_del'=>0,
  92. ]);
  93. $this->success('删除成功');
  94. }
  95. /**
  96. * 知识教学设置
  97. * @auth true
  98. * @menu true
  99. */
  100. public function setting(){
  101. $this->title='系统设置';
  102. if($this->request->isGet()){
  103. $config=systemConfig('teaching_config');
  104. $this->assign('config',$config);
  105. $this->fetch();
  106. }else{
  107. $data=$this->request->post();
  108. systemConfig('teaching_config',$data);
  109. $this->success('保存成功');
  110. }
  111. }
  112. }