作者 王智

daima

@@ -164,6 +164,27 @@ class Common extends Api @@ -164,6 +164,27 @@ class Common extends Api
164 } 164 }
165 165
166 166
  167 + /**
  168 + * 公共接口
  169 + * @ApiTitle (公共接口-图片预览)
  170 + * @ApiSummary (图片预览)
  171 + * @ApiMethod (POST)
  172 + * @ApiRoute (/api/Common/ImagesLook)
  173 + * @ApiParams (name="images", type="string", required=true, description="图片")
  174 + * @ApiReturnParams (name="code", type="integer", required=true, sample="0")
  175 + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
  176 + * @ApiReturn ({
  177 + 'code':'1',
  178 + 'msg':'返回成功',
  179 + })
  180 + */
  181 + public function ImagesLook()
  182 + {
  183 + $images = input('images');
  184 + $this->success('成功', cdnurl($images));
  185 + }
  186 +
  187 +
167 //准备中订单 188 //准备中订单
168 public function OkOrder() 189 public function OkOrder()
169 { 190 {
@@ -683,4 +683,82 @@ class User extends Api @@ -683,4 +683,82 @@ class User extends Api
683 $list['user_level'] = $user_type; 683 $list['user_level'] = $user_type;
684 $this->success('成功', $list); 684 $this->success('成功', $list);
685 } 685 }
  686 +
  687 +
  688 + /**
  689 + * 用户接口
  690 + * @ApiTitle (用户接口-找车操作)
  691 + * @ApiSummary (找车操作)
  692 + * @ApiMethod (POST)
  693 + * @ApiRoute (/api/User/WhereCarPeople)
  694 + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
  695 + * @ApiParams (name="order_id", type="int", required=true, description="订单ID")
  696 + * @ApiParams (name="type", type="int", required=true, description="找车工状态:1=已找到,0=未找到")
  697 + * @ApiParams (name="address", type="int", required=true, description="车辆地址")
  698 + * @ApiParams (name="lng", type="int", required=true, description="经度")
  699 + * @ApiParams (name="lat", type="int", required=true, description="纬度")
  700 + * @ApiParams (name="images", type="string", required=true, description="图片,多张图,拼接")
  701 + * @ApiReturnParams (name="code", type="integer", required=true, sample="0")
  702 + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
  703 + * @ApiReturn ({
  704 + 'code':'1',
  705 + 'msg':'返回成功',
  706 + })
  707 + */
  708 + public function WhereCarPeople()
  709 + {
  710 + $user_id = $this->is_token($this->request->header());
  711 + $param = $this->request->param();
  712 + $type = Db::name('user')->where('id', $user_id)->value('type');
  713 + if ($type != 2) {
  714 + $this->error('身份错误!', 0);
  715 + die;
  716 + }
  717 + $data = [
  718 + 'zhao_type' => $param['type'],
  719 + 'car_address' => $param['address'],
  720 + 'lat' => $param['lat'],
  721 + 'lng' => $param['lng'],
  722 + 'zhao_images' => $param['images'],
  723 + 'updatetime' => time()
  724 + ];
  725 + $res = Db::name('renwu')->where('id', $param['order_id'])->where('zhao_id', $user_id)->update($data);
  726 + $this->res($res);
  727 + }
  728 +
  729 +
  730 + /**
  731 + * 用户接口
  732 + * @ApiTitle (用户接口-洗车操作)
  733 + * @ApiSummary (洗车操作)
  734 + * @ApiMethod (POST)
  735 + * @ApiRoute (/api/User/CleanCarPeople)
  736 + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
  737 + * @ApiParams (name="order_id", type="int", required=true, description="订单ID")
  738 + * @ApiParams (name="type", type="int", required=true, description="洗车工状态:1=已清洗,0=未清洗")
  739 + * @ApiParams (name="images", type="string", required=true, description="图片,多张图,拼接")
  740 + * @ApiReturnParams (name="code", type="integer", required=true, sample="0")
  741 + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
  742 + * @ApiReturn ({
  743 + 'code':'1',
  744 + 'msg':'返回成功',
  745 + })
  746 + */
  747 + public function CleanCarPeople()
  748 + {
  749 + $user_id = $this->is_token($this->request->header());
  750 + $param = $this->request->param();
  751 + $type = Db::name('user')->where('id', $user_id)->value('type');
  752 + if ($type != 3) {
  753 + $this->error('身份错误!', 0);
  754 + die;
  755 + }
  756 + $data = [
  757 + 'xi_type' => $param['type'],
  758 + 'xi_images' => $param['images'],
  759 + 'updatetime' => time()
  760 + ];
  761 + $res = Db::name('renwu')->where('id', $param['order_id'])->where('xi_id', $user_id)->update($data);
  762 + $this->res($res);
  763 + }
686 } 764 }