UserTax.php 802 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\controller\mall\Orders;
  4. use app\common\controller\Api;
  5. /**
  6. * 发票接口
  7. */
  8. class UserTax extends Api
  9. {
  10. protected $noNeedRight='*';
  11. /**
  12. * 发票列表
  13. * @ApiParams (name=page,dexcription=分页)
  14. * @ApiParams (name=limit,dexcription=分页)
  15. */
  16. public function list(){
  17. $user=$this->auth->getUser();
  18. $tax=$user->tax()
  19. ->with(['orders'])
  20. ->order('id','desc')
  21. ->paginate(input('limit',15));
  22. $newList=[];
  23. foreach ($tax->items() as $item){
  24. $order=[
  25. 'order_no'=>$item['orders']['order_no']??'',
  26. 'create_time'=>$item['orders']['create_time']??'',
  27. ];
  28. }
  29. $this->success('',$tax);
  30. }
  31. }