|
@@ -0,0 +1,45 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\api\controller;
|
|
|
+
|
|
|
+use app\common\controller\Api;
|
|
|
+use app\service\Pet;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 用户端订单接口
|
|
|
+ */
|
|
|
+class UserOrder extends Api
|
|
|
+{
|
|
|
+ protected $noNeedLogin = ['category','spec'];
|
|
|
+ protected $noNeedRight = '*';
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 常用地址
|
|
|
+ * @ApiReturnParams (name=id,description=id)
|
|
|
+ * @ApiReturnParams (name=name,description=姓名)
|
|
|
+ * @ApiReturnParams (name=mobile,description=手机号)
|
|
|
+ * @ApiReturnParams (name=address,description=地址)
|
|
|
+ * @ApiReturnParams (name=city,description=城市)
|
|
|
+ */
|
|
|
+ public function address(){
|
|
|
+ $user=$this->auth->getUser();
|
|
|
+ $this->success('',$user->addres()->order('id','desc')->select());
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 宠物类别
|
|
|
+ * @ApiReturnParams (name=id,description=id)
|
|
|
+ * @ApiReturnParams (name=name,description=名称)
|
|
|
+ */
|
|
|
+ public function category(Pet $pet){
|
|
|
+ $this->success('',$pet::category());
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 宠物规格
|
|
|
+ * @ApiReturnParams (name=id,description=id)
|
|
|
+ * @ApiReturnParams (name=name,description=名称)
|
|
|
+ * @ApiReturnParams (name=weight,description=重量范围)
|
|
|
+ */
|
|
|
+ public function spec(Pet $pet){
|
|
|
+ $this->success('',$pet::spec());
|
|
|
+ }
|
|
|
+}
|