链街Dcat后台
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.

83 lines
2.0 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Admin\Controllers\v3;
  3. use App\Admin\Repositories\v3\OrderReport;
  4. use Dcat\Admin\Form;
  5. use Dcat\Admin\Grid;
  6. use Dcat\Admin\Show;
  7. use Dcat\Admin\Controllers\AdminController;
  8. use Dcat\Admin\Layout\Content;
  9. use Dcat\Admin\Form\Row;
  10. use Dcat\Admin\Grid\Column;
  11. use App\Models\v3\Market as marketModel;
  12. use App\Models\ImsCjdcOrder as OrderModel;
  13. use Illuminate\Support\Facades\DB;
  14. use App\Admin\Extensions\OrderReportPage;
  15. class OrderReportController extends AdminController
  16. {
  17. /**
  18. * Make a grid builder.
  19. *
  20. * @return Grid
  21. */
  22. protected function grid()
  23. {
  24. $marketId = request()->get('market_id');
  25. return Grid::make(new OrderReport(), function (Grid $grid) {
  26. });
  27. }
  28. public function index(Content $content)
  29. {
  30. // $marketId = request()->input('market_id');
  31. $where = [];
  32. $orderTable = 'lanzu_order_main';
  33. // $order = DB::select('SELECT COUNT(id) AS total_num, SUM(money) AS total_money, FROM '.$orderTable.' WHERE state IN (4,5,10) ', $where);
  34. // 实例化表单类并传递自定义参数
  35. $detail = OrderReportPage::make();
  36. return $content->header("")
  37. ->breadcrumb(
  38. ['text' => '详情', 'url' => 'detail']
  39. )
  40. ->body(Lazy::make($detail));
  41. }
  42. /**
  43. * Make a show builder.
  44. *
  45. * @param mixed $id
  46. *
  47. * @return Show
  48. */
  49. protected function detail($id)
  50. {
  51. return Show::make($id, new OrderModel(), function (Show $show) {
  52. $show->id;
  53. $show->market_id;
  54. $show->name;
  55. $show->mm_user_id;
  56. });
  57. }
  58. /**
  59. * Make a form builder.
  60. *
  61. * @return Form
  62. */
  63. protected function form()
  64. {
  65. return Form::make(new OrderModel(), function (Form $form) {
  66. $form->display('id');
  67. $form->text('market_id');
  68. $form->text('name');
  69. $form->text('mm_user_id');
  70. });
  71. }
  72. }