|
|
@@ -286,7 +286,7 @@ class User extends BaseController
|
|
|
$save["service_type"] = $post["service_type"];
|
|
|
}
|
|
|
//服务价格区间
|
|
|
- $save["service_price"] = empty($post["service_price"]) ? "" : $post["service_price"];
|
|
|
+// $save["service_price"] = empty($post["service_price"]) ? "" : $post["service_price"];
|
|
|
$save["service_min_price"] = empty($post["service_min_price"]) ? 0 : $post["service_min_price"];
|
|
|
$save["service_max_price"] = empty($post["service_max_price"]) ? 0 : $post["service_max_price"];
|
|
|
//服务区域
|
|
|
@@ -657,28 +657,27 @@ class User extends BaseController
|
|
|
* @param Request $request
|
|
|
*/
|
|
|
public function uploadBase64(Request $request){
|
|
|
- [$img] = UtilService::getMore([
|
|
|
+ [$img,$code] = UtilService::getMore([
|
|
|
['img', '','empty',"请上传图片"],
|
|
|
+ ['code', 'image'],
|
|
|
], $request,true);
|
|
|
- $imgAr = explode("base64,",$img);
|
|
|
- if(empty($imgAr)){
|
|
|
- return app("json")->fail("请上传base64图片");
|
|
|
- }
|
|
|
- $imgBase64 = count($imgAr)==1?$imgAr[0]:$imgAr[1];
|
|
|
- $contentType = "image/jpeg";
|
|
|
- if(count($imgAr)>1){
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //判断字符串是否经过编码方法
|
|
|
- if($imgBase64!=base64_encode(base64_decode($imgBase64))){
|
|
|
- return app("json")->fail("请上传base64图片");
|
|
|
+// $imgAr = explode("base64,",$img);
|
|
|
+// if(empty($imgAr)){
|
|
|
+// return app("json")->fail("请上传base64图片");
|
|
|
+// }
|
|
|
+// $imgBase64 = count($imgAr)==1?$imgAr[0]:$imgAr[1];
|
|
|
+// //判断字符串是否经过编码方法
|
|
|
+// if($imgBase64!=base64_encode(base64_decode($imgBase64))){
|
|
|
+// return app("json")->fail("请上传base64图片");
|
|
|
+// }
|
|
|
+// $base64 = "data:application/octet-stream;base64,".$imgBase64;//七牛
|
|
|
+ $res = $this->uploadImageBase64($code,$img);
|
|
|
+ if($res["code"]!=1){
|
|
|
+ return app('json')->fail($res["msg"]);
|
|
|
}
|
|
|
+ return app('json')->success(["img"=>$res["data"]]);
|
|
|
|
|
|
|
|
|
-
|
|
|
- $img = "data:application/octet-stream;base64,".$imgBase64;
|
|
|
}
|
|
|
|
|
|
|