Api.php 914 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\common\controller;
  3. use app\BaseController;
  4. use app\common\middleware\Auth;
  5. use think\facade\Db;
  6. /**
  7. * 需要权限的公共方法放这
  8. * Description of Tool
  9. *
  10. * @author sgq
  11. */
  12. class Api extends BaseController {
  13. protected $middleware = [Auth::class];
  14. protected $usertype;
  15. public function __construct(\think\App $app) {
  16. parent::__construct($app);
  17. $this->usertype = session("user")["usertype"];
  18. }
  19. public function findCommonFileType() {
  20. $param = $this->request->param();
  21. $order = $param["order"];
  22. $project = $param["project"];
  23. $type = $param["type"];
  24. $where[] = ["project", "=", $project];
  25. $where[] = ["type", "=", $type];
  26. return json(["rows" => Db::table("new_common_filetype")->where($where)->order("sn " . $order)->select()]);
  27. }
  28. public function listTalentFile() {
  29. }
  30. }