AppointList.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace app\admin\controller\box;
  3. use app\admin\logic\BoxRecordLogic;
  4. use app\common\model\BoxRecordModel;
  5. use app\admin\traits\Curd;
  6. use app\common\controller\AdminController;
  7. use EasyAdmin\annotation\ControllerAnnotation;
  8. use EasyAdmin\annotation\NodeAnotation;
  9. use think\App;
  10. use think\facade\Db;
  11. use think\Model;
  12. /**
  13. * Class Admin
  14. * @package app\admin\controller\system
  15. * @ControllerAnnotation(title="魔盒")
  16. */
  17. class AppointList extends AdminController
  18. {
  19. public function __construct(App $app)
  20. {
  21. parent::__construct($app);
  22. $this->model = new BoxRecordModel();
  23. }
  24. use Curd;
  25. /**
  26. * @NodeAnotation(title="预约记录")
  27. */
  28. public function index()
  29. {
  30. if ($this->request->isAjax()) {
  31. if (input('selectFields')) {
  32. return $this->selectList();
  33. }
  34. list($page, $limit, $where) = $this->buildTableParames();
  35. list($count, $list) = BoxRecordLogic::getList($page, $limit, $where, $this->sort);
  36. $data = [
  37. 'code' => 0,
  38. 'msg' => '',
  39. 'count' => $count,
  40. 'data' => $list,
  41. ];
  42. return json($data);
  43. }
  44. return $this->fetch();
  45. }
  46. }