AppParamsController.php 873 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\admin\controller\client;
  3. use app\controller\Curd;
  4. use app\model\SysConfig;
  5. use support\Request;
  6. use support\Response;
  7. class AppParamsController extends Curd
  8. {
  9. public function __construct()
  10. {
  11. $this->model = new SysConfig();
  12. }
  13. public function select(Request $request): Response
  14. {
  15. [$where, $format, $limit, $field, $order] = $this->selectInput($request);
  16. $where['config_category'] = 'APP';
  17. $query = $this->doSelect($where, $field, $order);
  18. return $this->doFormat($query, $format, $limit);
  19. }
  20. protected function insertInput(Request $request): array
  21. {
  22. $data = $this->inputFilter($request->post());
  23. $data['config_category'] = 'APP';
  24. if (empty($data['config_value_json'])){
  25. $data['config_value_json'] = '[]';
  26. }
  27. return $data;
  28. }
  29. }