Report.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\admin\controller;
  4. use app\admin\BaseController;
  5. use think\Request;
  6. use think\facade\Db;
  7. class Report extends BaseController
  8. {
  9. /**
  10. * 显示资源列表
  11. *
  12. * @return \think\Response
  13. */
  14. public function index()
  15. {
  16. $page= isset($this->post['page'])&&$this->post['page']!='' ? intval($this->post['page']) :1;
  17. $size= isset($this->post['size'])&&$this->post['size']!='' ? intval($this->post['size']) :15;
  18. $qrdNo =isset($this->post['qrdNo'])&& $this->post['qrdNo']!=''? trim($this->post['qrdNo']):"";
  19. $cgdNo =isset($this->post['cgdNo'])&& $this->post['cgdNo']!=''? trim($this->post['cgdNo']):"";
  20. $companyNo =isset($this->post['companyNo'])&& $this->post['companyNo']!=''? trim($this->post['companyNo']):"";
  21. $supplierNo =isset($this->post['supplierNo'])&& $this->post['supplierNo']!=''? trim($this->post['supplierNo']):"";
  22. $customerNo =isset($this->post['customerNo'])&& $this->post['customerNo']!=''? trim($this->post['customerNo']):"";
  23. $payNo =isset($this->post['payNo'])&& $this->post['payNo']!=''? trim($this->post['payNo']):"";
  24. $dzNo =isset($this->post['dzNo'])&& $this->post['dzNo']!=''? trim($this->post['dzNo']):"";
  25. $hpNo =isset($this->post['hpNo'])&& $this->post['hpNo']!=''? trim($this->post['hpNo']):"";
  26. $invNo =isset($this->post['invNo'])&& $this->post['invNo']!=''? trim($this->post['invNo']):"";
  27. $tradNo =isset($this->post['tradNo'])&& $this->post['tradNo']!=''? trim($this->post['tradNo']):"";
  28. $logNo =isset($this->post['logNo'])&& $this->post['logNo']!=''? trim($this->post['logNo']):"";
  29. $returnInv =isset($this->post['returnInv'])&& $this->post['returnInv']!=''? trim($this->post['returnInv']):"";
  30. $returnTrad =isset($this->post['returnTrad'])&& $this->post['returnTrad']!=''? trim($this->post['returnTrad']):"";
  31. $seller_id =isset($this->post['seller_id'])&& $this->post['seller_id']!=''? intval($this->post['seller_id']):"";
  32. $cgder_id =isset($this->post['cgder_id'])&& $this->post['cgder_id']!=''? intval($this->post['cgder_id']):"";
  33. $cgder =isset($this->post['cgder'])&& $this->post['cgder']!=''? trim($this->post['cgder']):"";
  34. $seller =isset($this->post['seller'])&& $this->post['seller']!=''? trim($this->post['seller']):"";
  35. $where=[];
  36. if($qrdNo!='') $where[]=["qrdNo","like","%$qrdNo%"];
  37. if($cgdNo!='') $where[]=["cgdNo","like","%$cgdNo%"];
  38. if($companyNo!='') $where[]=["companyNo","like","%$companyNo%"];
  39. if($supplierNo!='') $where[]=["supplierNo","like","%$supplierNo%"];
  40. if($customerNo!='') $where[]=["customerNo","like","%$customerNo%"];
  41. if($payNo!='') $where[]=["payNo","like","%$payNo%"];
  42. if($dzNo!='') $where[]=["DzNo","like","%$dzNo%"];
  43. if($hpNo!='') $where[]=["hpNo","like","%$hpNo%"];
  44. if($invNo!='') $where[]=["invNo","like","%$invNo%"];
  45. if($tradNo!='') $where[]=["tradNo","like","%$tradNo%"];
  46. if($logNo!='') $where[]=["logNo","like","%$logNo%"];
  47. if($returnInv!='') $where[]=["returnInv","like","%$returnInv%"];
  48. if($returnTrad!='') $where[]=["returnTrad","like","%$returnTrad%"];
  49. if($seller_id!='') $where[]=["seller_id","=",$seller_id];
  50. if($cgder_id!='') $where[]=["cgder_id","=",$cgder_id];
  51. if($cgder!='') $where[]=["cgder","like","%$cgder%"];
  52. if($seller!='') $where[]=["seller","like","%$seller%"];
  53. $count =Db::name("report_code")->where($where)->count();
  54. $total = ceil($count/$size);
  55. $page =$page>=$total ? intval($total) : $page;
  56. $list =Db::name("report_code")->where($where)->page($page,$size)->order("id desc")->select();
  57. return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
  58. }
  59. /**
  60. * 显示创建资源表单页.
  61. *
  62. * @return \think\Response
  63. */
  64. public function create()
  65. {
  66. //
  67. }
  68. /**
  69. * 保存新建的资源
  70. *
  71. * @param \think\Request $request
  72. * @return \think\Response
  73. */
  74. public function save(Request $request)
  75. {
  76. //
  77. }
  78. /**
  79. * 显示指定的资源
  80. *
  81. * @param int $id
  82. * @return \think\Response
  83. */
  84. public function read($id)
  85. {
  86. //
  87. }
  88. /**
  89. * 显示编辑资源表单页.
  90. *
  91. * @param int $id
  92. * @return \think\Response
  93. */
  94. public function edit($id)
  95. {
  96. //
  97. }
  98. /**
  99. * 保存更新的资源
  100. *
  101. * @param \think\Request $request
  102. * @param int $id
  103. * @return \think\Response
  104. */
  105. public function update(Request $request, $id)
  106. {
  107. //
  108. }
  109. /**
  110. * 删除指定资源
  111. *
  112. * @param int $id
  113. * @return \think\Response
  114. */
  115. public function delete($id)
  116. {
  117. //
  118. }
  119. }