控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

controllerindex.stub 1.0KB

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * 查看
  3. */
  4. public function index()
  5. {
  6. //当前是否为关联查询
  7. $this->relationSearch = {%relationSearch%};
  8. //设置过滤方法
  9. $this->request->filter(['strip_tags', 'trim']);
  10. if ($this->request->isAjax()) {
  11. //如果发送的来源是Selectpage,则转发到Selectpage
  12. if ($this->request->request('keyField')) {
  13. return $this->selectpage();
  14. }
  15. [$page, $limit, $where, $sort, $order] = $this->buildTableParames();
  16. $list = $this->modelClass
  17. {%relationWithList%}
  18. ->where($where)
  19. ->order($sort, $order)
  20. ->paginate($limit);
  21. foreach ($list as $row) {
  22. {%visibleFieldList%}
  23. {%relationVisibleFieldList%}
  24. }
  25. $result = ["code" => 0, "count" => $list->total(), "data" => $list->items()];
  26. return json($result);
  27. }
  28. return $this->fetch();
  29. }