截流自动化的商城平台
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

Invoice.php 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop开源商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | gitee下载:https://gitee.com/likeshop_gitee
  7. // | github下载:https://github.com/likeshop-github
  8. // | 访问官网:https://www.likeshop.cn
  9. // | 访问社区:https://home.likeshop.cn
  10. // | 访问手册:http://doc.likeshop.cn
  11. // | 微信公众号:likeshop技术社区
  12. // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
  13. // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
  14. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  15. // | likeshop团队版权所有并拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshop.cn.team
  18. // +----------------------------------------------------------------------
  19. namespace app\admin\controller\order;
  20. use app\common\basics\AdminBase;
  21. use app\common\model\order\Order;
  22. use app\common\server\JsonServer;
  23. use app\admin\logic\order\InvoiceLogic;
  24. /**
  25. * 发票管理
  26. * Class Invoice
  27. * @package app\shop\controller\order
  28. */
  29. class Invoice extends AdminBase
  30. {
  31. /**
  32. * @notes 发票列表
  33. * @return \think\response\Json|\think\response\View
  34. * @author 段誉
  35. * @date 2022/4/12 17:34
  36. */
  37. public function lists()
  38. {
  39. if ($this->request->isAjax()) {
  40. $get = $this->request->get();
  41. return JsonServer::success('', InvoiceLogic::getInvoiceLists($get));
  42. }
  43. return view('', [
  44. 'order_status' => order::getOrderStatus(true)
  45. ]);
  46. }
  47. /**
  48. * @notes 开票
  49. * @return \think\response\Json|\think\response\View
  50. * @author 段誉
  51. * @date 2022/4/12 19:00
  52. */
  53. public function detail()
  54. {
  55. $id = $this->request->get('id/d');
  56. return view('detail', [
  57. 'detail' => InvoiceLogic::detail($id)
  58. ]);
  59. }
  60. /**
  61. * @notes 导出Excel
  62. * @return \think\response\Json
  63. * @throws \think\db\exception\DataNotFoundException
  64. * @throws \think\db\exception\DbException
  65. * @throws \think\db\exception\ModelNotFoundException
  66. * @author 段誉
  67. * @date 2022/4/24 10:20
  68. */
  69. public function export()
  70. {
  71. $params = $this->request->get();
  72. $result = InvoiceLogic::getInvoiceLists($params, true);
  73. if(false === $result) {
  74. return JsonServer::error(InvoiceLogic::getError() ?: '导出失败');
  75. }
  76. return JsonServer::success('', $result);
  77. }
  78. }