UserOrder.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use app\service\Pet;
  5. /**
  6. * 用户端订单接口
  7. */
  8. class UserOrder extends Api
  9. {
  10. protected $noNeedLogin = ['category','spec','protect'];
  11. protected $noNeedRight = '*';
  12. /**
  13. * 常用地址
  14. * @ApiReturnParams (name=id,description=id)
  15. * @ApiReturnParams (name=name,description=姓名)
  16. * @ApiReturnParams (name=mobile,description=手机号)
  17. * @ApiReturnParams (name=address,description=地址)
  18. * @ApiReturnParams (name=city,description=城市)
  19. */
  20. public function address(){
  21. $user=$this->auth->getUser();
  22. $this->success('',$user->addres()->order('id','desc')->select());
  23. }
  24. /**
  25. * 宠物类别
  26. * @ApiReturnParams (name=id,description=id)
  27. * @ApiReturnParams (name=name,description=名称)
  28. */
  29. public function category(Pet $pet){
  30. $this->success('',$pet::category());
  31. }
  32. /**
  33. * 宠物规格
  34. * @ApiReturnParams (name=id,description=id)
  35. * @ApiReturnParams (name=name,description=名称)
  36. * @ApiReturnParams (name=weight,description=重量范围)
  37. */
  38. public function spec(Pet $pet){
  39. $this->success('',$pet::spec());
  40. }
  41. /**
  42. * 宠物保
  43. * @ApiReturnParams (name=id,description=id)
  44. * @ApiReturnParams (name=name,description=名称)
  45. * @ApiReturnParams (name=max,description=最高保多少)
  46. * @ApiReturnParams (name=price,description=价格)
  47. */
  48. public function protect(Pet $pet){
  49. $this->success('',$pet::protect());
  50. }
  51. /**
  52. * 预下单
  53. * @param
  54. */
  55. public function prepare(){
  56. $data=input();
  57. }
  58. }