控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Yzncms [ 御宅男工作室 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2018 http://yzncms.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 御宅男 <530765310@qq.com>
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | 模型管理
  13. // +----------------------------------------------------------------------
  14. namespace app\admin\controller\cms;
  15. use app\admin\model\cms\Models as ModelsModel;
  16. use app\common\controller\Adminbase;
  17. class Models extends Adminbase
  18. {
  19. protected $modelClass = null;
  20. protected $modelValidate = true;
  21. protected function initialize()
  22. {
  23. parent::initialize();
  24. $this->modelClass = new ModelsModel;
  25. //取得当前内容模型模板存放目录
  26. $this->filepath = TEMPLATE_PATH . (empty(config('site.theme')) ? "default" : config('site.theme')) . DS . "cms" . DS;
  27. //取得栏目频道模板列表
  28. $this->tp_category = str_replace($this->filepath . DS, '', glob($this->filepath . DS . 'category*'));
  29. //取得栏目列表模板列表
  30. $this->tp_list = str_replace($this->filepath . DS, '', glob($this->filepath . DS . 'list*'));
  31. //取得内容页模板列表
  32. $this->tp_show = str_replace($this->filepath . DS, '', glob($this->filepath . DS . 'show*'));
  33. $this->assign("tp_category", $this->tp_category);
  34. $this->assign("tp_list", $this->tp_list);
  35. $this->assign("tp_show", $this->tp_show);
  36. }
  37. //模型列表
  38. public function index()
  39. {
  40. if ($this->request->isAjax()) {
  41. $data = $this->modelClass->where('module', 'cms')->select();
  42. return json(["code" => 0, "data" => $data]);
  43. }
  44. return $this->fetch();
  45. }
  46. }