|
|
@@ -46,7 +46,7 @@ use think\Route;
|
|
|
|
|
|
class User extends BaseController
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 获取用户详情
|
|
|
* @param Request $request
|
|
|
@@ -68,30 +68,30 @@ class User extends BaseController
|
|
|
$data['work_type_id'] = $request->user['work_type_id'];//用户职称类型
|
|
|
$data['work_type_title'] = $request->user['work_type_title'];//用户职称类型名称
|
|
|
$data['card_look_count'] = $request->user['card_look_count'];//用户名片浏览次数
|
|
|
-
|
|
|
+
|
|
|
$data['info_audit_status'] = empty($infoAuditData)?-2:$infoAuditData["status"];
|
|
|
$data['user_audit_status'] = empty($userAuditData)?-2:$userAuditData["status"];
|
|
|
$data['type_audit_status'] = empty($typeAuditData)?-2:$typeAuditData["status"];
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
//资料通过需要重新提交认证
|
|
|
if(!empty($infoAuditData) && !empty($typeAuditData)){
|
|
|
if($infoAuditData["status"]==1 && $typeAuditData["status"]==1 && $infoAuditData["admin_time"]>$typeAuditData["admin_time"]){
|
|
|
$data['type_audit_status'] = -3;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
$data['show_template_code'] = "";
|
|
|
$data['show_template_id'] = "";
|
|
|
$tmpData = (new UserShowTemplate)
|
|
|
- ->field("t.id,t.code,t.title,t.is_init,b.is_default")
|
|
|
- ->alias("b")
|
|
|
- ->join("show_template t","t.id = b.show_template_id","left")
|
|
|
- ->where("b.uid",$request->user['uid'])
|
|
|
- ->order("b.is_default","desc")
|
|
|
- ->order("b.id","desc")
|
|
|
- ->find();
|
|
|
+ ->field("t.id,t.code,t.title,t.is_init,b.is_default")
|
|
|
+ ->alias("b")
|
|
|
+ ->join("show_template t","t.id = b.show_template_id","left")
|
|
|
+ ->where("b.uid",$request->user['uid'])
|
|
|
+ ->order("b.is_default","desc")
|
|
|
+ ->order("b.id","desc")
|
|
|
+ ->find();
|
|
|
if(!empty($tmpData)){
|
|
|
$data['show_template_code'] = $tmpData["code"];
|
|
|
$data['show_template_id'] = $tmpData["id"];
|
|
|
@@ -116,57 +116,57 @@ class User extends BaseController
|
|
|
$data = (new UserModel)->getDataList($post,"u.uid,u.mobile,u.nickname,u.avatar");
|
|
|
return app('json')->success($data);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取用户总邀请人数排行榜
|
|
|
* @param Request $request
|
|
|
*/
|
|
|
- public function getInviterRanking(Request $request){
|
|
|
- $time = $request->param('time', time());
|
|
|
- $times = explode(" - ",$time);
|
|
|
- $page = $request->param('page', 1); // 获取请求中的页码参数,默认为 1
|
|
|
- $pageSize = $request->param('pageSize', 6); // 获取请求中的每页记录数参数,默认为 6
|
|
|
- if(sizeof($times)==2)
|
|
|
- {
|
|
|
- $count = (new UserModel) -> where('parent_uid', $request->user['uid'])->where('regtime','>=',$times[0])->where('regtime','<',$times[1])->count();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- $count = (new UserModel) -> where('parent_uid', $request->user['uid'])->count();
|
|
|
- }
|
|
|
- $uids = (new UserModel) -> where('parent_uid', $request->user['uid'])
|
|
|
- -> column('uid');
|
|
|
- $InfoAudit= new InfoAudit();
|
|
|
- $list = [];
|
|
|
- if ($count == 0) {
|
|
|
- $list = (new UserModel)
|
|
|
- -> where('uid', '<>', $request->user['uid'])
|
|
|
- -> orderRaw('RAND()')
|
|
|
- -> limit(6)
|
|
|
- -> field('uid, nickname, avatar')
|
|
|
- -> select()
|
|
|
- -> toArray();
|
|
|
- foreach ($list as &$v) {
|
|
|
- $v['count'] = (new UserModel)->where('parent_uid', $v['uid'])->count();
|
|
|
- }
|
|
|
- } else {
|
|
|
- $list = (new UserModel)
|
|
|
- -> where('parent_uid', 'in', $uids)
|
|
|
- -> group('parent_uid')
|
|
|
- -> field('parent_uid AS uid, COUNT(*) AS count')
|
|
|
- -> order('count', 'DESC')
|
|
|
- -> page($page, $pageSize)
|
|
|
- -> select()
|
|
|
- -> toArray();
|
|
|
- foreach ($list as &$v) {
|
|
|
- $user = (new UserModel)->where('uid', $v['uid'])->field('nickname, avatar')->find();
|
|
|
- $v['nickname'] = $user['nickname'];
|
|
|
- $v['avatar'] = $user['avatar'];
|
|
|
- }
|
|
|
- }
|
|
|
+ public function getInviterRanking(Request $request){
|
|
|
+ $time = $request->param('time', time());
|
|
|
+ $times = explode(" - ",$time);
|
|
|
+ $page = $request->param('page', 1); // 获取请求中的页码参数,默认为 1
|
|
|
+ $pageSize = $request->param('pageSize', 6); // 获取请求中的每页记录数参数,默认为 6
|
|
|
+ if(sizeof($times)==2)
|
|
|
+ {
|
|
|
+ $count = (new UserModel) -> where('parent_uid', $request->user['uid'])->where('regtime','>=',$times[0])->where('regtime','<',$times[1])->count();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $count = (new UserModel) -> where('parent_uid', $request->user['uid'])->count();
|
|
|
+ }
|
|
|
+ $uids = (new UserModel) -> where('parent_uid', $request->user['uid'])
|
|
|
+ -> column('uid');
|
|
|
+ $InfoAudit= new InfoAudit();
|
|
|
+ $list = [];
|
|
|
+ if ($count == 0) {
|
|
|
+ $list = (new UserModel)
|
|
|
+ -> where('uid', '<>', $request->user['uid'])
|
|
|
+ -> orderRaw('RAND()')
|
|
|
+ -> limit(6)
|
|
|
+ -> field('uid, nickname, avatar')
|
|
|
+ -> select()
|
|
|
+ -> toArray();
|
|
|
+ foreach ($list as &$v) {
|
|
|
+ $v['count'] = (new UserModel)->where('parent_uid', $v['uid'])->count();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $list = (new UserModel)
|
|
|
+ -> where('parent_uid', 'in', $uids)
|
|
|
+ -> group('parent_uid')
|
|
|
+ -> field('parent_uid AS uid, COUNT(*) AS count')
|
|
|
+ -> order('count', 'DESC')
|
|
|
+ -> page($page, $pageSize)
|
|
|
+ -> select()
|
|
|
+ -> toArray();
|
|
|
+ foreach ($list as &$v) {
|
|
|
+ $user = (new UserModel)->where('uid', $v['uid'])->field('nickname, avatar')->find();
|
|
|
+ $v['nickname'] = $user['nickname'];
|
|
|
+ $v['avatar'] = $user['avatar'];
|
|
|
+ }
|
|
|
+ }
|
|
|
return app('json')->success(compact('count','list'));
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -208,7 +208,7 @@ class User extends BaseController
|
|
|
if($isInfoAudit==0){
|
|
|
$r = (new UserModel)->where("uid",$request->user["uid"])->update($save);
|
|
|
if(!$r){
|
|
|
- return app("json")->fail("提交数据为空");
|
|
|
+ return app("json")->fail("提交数据为空");
|
|
|
}
|
|
|
}else{
|
|
|
$data = (new UserAudit)->where("uid",$request->user["uid"])->order("id desc")->find();
|
|
|
@@ -216,17 +216,17 @@ class User extends BaseController
|
|
|
return app('json')->fail("资料审核中,请勿重复提交");
|
|
|
}
|
|
|
$save["uid"] = $request->user["uid"];
|
|
|
- $save["status"] = 0;
|
|
|
+ $save["status"] = 0;
|
|
|
$r = (new UserAudit)->insert($save);
|
|
|
if(!$r){
|
|
|
- return app("json")->fail("提交数据为空");
|
|
|
+ return app("json")->fail("提交数据为空");
|
|
|
}
|
|
|
}
|
|
|
return app("json")->success("提交成功");
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 绑定手机号
|
|
|
* @param Request $request
|
|
|
@@ -259,7 +259,7 @@ class User extends BaseController
|
|
|
$result['avatar'] = $request->user['avatar'];
|
|
|
return app('json')->success($result);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 获取名片信息
|
|
|
* @param Request $request
|
|
|
@@ -270,13 +270,13 @@ class User extends BaseController
|
|
|
return app('json')->fail("您还没有通过名片信息审核");
|
|
|
}
|
|
|
$typeData = (new TypeAudit)->where("uid",$request->user["uid"])->order("id","desc")->find();
|
|
|
- $data["is_type_audit"] = (empty($typeData) || $typeData["status"]!=1)?0:1;
|
|
|
+ $data["is_type_audit"] = (empty($typeData) || $typeData["status"]!=1)?0:1;
|
|
|
return app('json')->success($data);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 提交资料审核
|
|
|
* @param Request $request
|
|
|
@@ -302,18 +302,17 @@ class User extends BaseController
|
|
|
['service_intro_imgs',[]],
|
|
|
['service_audit_imgs',[]],//此处为我的证书
|
|
|
['service_imgs',[]],//我的服务照片
|
|
|
-
|
|
|
+ ['service_count',0],
|
|
|
['work_year',''],
|
|
|
['ancestral_place',''],
|
|
|
['education',''],
|
|
|
['minority',''],
|
|
|
-
|
|
|
+ ['is_china',1],
|
|
|
+
|
|
|
['user_work_type_id','0'],//服务职称
|
|
|
['service_label',[]],//服务标签
|
|
|
- ['is_china',''],
|
|
|
- ['service_count',''],
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
],$request);
|
|
|
if(!IdentityCard::isValid($post["idcard"])){
|
|
|
return app('json')->fail("请输入正确的身份证号码");
|
|
|
@@ -323,12 +322,14 @@ class User extends BaseController
|
|
|
$save["name"] = empty($post["name"]) ? "" : $post["name"];
|
|
|
$save["mobile"] = empty($post["mobile"]) ? "" : $post["mobile"];
|
|
|
$save["idcard"] = empty($post["idcard"]) ? "" : $post["idcard"];
|
|
|
+ $save["service_count"] = $post['service_count'];
|
|
|
+
|
|
|
// $save["birthday"] = empty($post["birthday"])? 0 : strtotime($post["birthday"]);
|
|
|
-
|
|
|
+
|
|
|
$save["constellation"] = IdentityCard::get_starsign($post["idcard"]);//星座
|
|
|
$save["twelve"] = IdentityCard::get_zodiac($post["idcard"]);//星座
|
|
|
$save["birthday"] = strtotime(IdentityCard::get_birthday($post["idcard"]));
|
|
|
-
|
|
|
+
|
|
|
//服务类型
|
|
|
if(!empty($post["service_type"])){
|
|
|
$timeTypeData = (new ServiceTimeType)->where("code",$post["service_type"])->where("status",1)->select();
|
|
|
@@ -384,41 +385,32 @@ class User extends BaseController
|
|
|
$save["service_intro_imgs"] = empty($post["service_intro_imgs"]) ? "" : implode(",", $post["service_intro_imgs"]);
|
|
|
$save["service_audit_imgs"] = empty($post["service_audit_imgs"]) ? "" : implode(",", $post["service_audit_imgs"]);
|
|
|
$save["service_imgs"] = empty($post["service_imgs"]) ? "" : implode(",", $post["service_imgs"]);//我的服务展示
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
$save['work_year'] = empty($post["work_year"]) ? "": $post["work_year"];
|
|
|
$save['ancestral_place'] = empty($post["ancestral_place"])? "": $post["ancestral_place"];
|
|
|
$save['education'] = empty($post["education"]) ? "": $post["education"];
|
|
|
$save['minority'] = empty($post["minority"]) ? "": $post["minority"];
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
$save["status"] = 0;
|
|
|
$save["time"] = time();
|
|
|
- $save['is_china'] = $post['is_china'];//服务区域
|
|
|
- $save['service_count'] = $post['service_count'];
|
|
|
$save["uid"] = $request->user["uid"];
|
|
|
-
|
|
|
+
|
|
|
//服务职称
|
|
|
$save["user_work_type_id"] = empty($post["user_work_type_id"]) ? 0: (int)$post["user_work_type_id"];
|
|
|
if($save["user_work_type_id"]>0 && (new UserWorkType)->where("id",$post["user_work_type_id"])->where("status",1)->count()<=0){
|
|
|
return app('json')->fail("当前类型不能选择");
|
|
|
}
|
|
|
|
|
|
- //生成编码
|
|
|
+
|
|
|
$r = (new InfoAudit)->insertGetId($save);
|
|
|
- if (!$r) {
|
|
|
+ if(!$r){
|
|
|
return app('json')->fail("系统错误");
|
|
|
}
|
|
|
- $exist = (new InfoAudit)->where('uid', $save['uid'])->find();
|
|
|
- if ($exist && !empty($exist['no'])) {
|
|
|
- $no = $exist['no'];
|
|
|
- } else {
|
|
|
- $id = str_pad($r, 6, "0", STR_PAD_LEFT);
|
|
|
- $no = "MYJ" . date("Ymd") . $id;
|
|
|
- }
|
|
|
- (new InfoAudit)->where("id", $r)->update(["no" => $no]);
|
|
|
-
|
|
|
+ $no = "MYJ".date("Ymd").$r;
|
|
|
+ (new InfoAudit)->where("id",$r)->update(["no"=>$no]);
|
|
|
return app('json')->success("提交成功,请耐心等待审核");
|
|
|
}
|
|
|
/**
|
|
|
@@ -441,7 +433,7 @@ class User extends BaseController
|
|
|
if(empty($save["service_audit_imgs"])){
|
|
|
return app('json')->fail("请上传服务认证截图");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$r = (new TypeAudit)->insertGetId($save);
|
|
|
if(!$r){
|
|
|
return app('json')->fail("系统错误");
|
|
|
@@ -450,8 +442,8 @@ class User extends BaseController
|
|
|
(new TypeAudit)->where("id",$r)->update(["no"=>$no]);
|
|
|
return app('json')->success("提交成功,请耐心等待审核");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 模板订单提交[第一步]
|
|
|
* @param Request $request
|
|
|
@@ -461,17 +453,17 @@ class User extends BaseController
|
|
|
['id','','empty','参数错误'],
|
|
|
['pay_type','','empty','请选择支付方式'],
|
|
|
],$request,true);
|
|
|
-
|
|
|
+
|
|
|
if(!in_array($pay_type,["wxpay","balance"])){
|
|
|
return app('json')->fail('不支持该支付方式!');
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$weixinConfig = (new SysModel)->getWeixinConfig();
|
|
|
// if(empty($weixinConfig)){
|
|
|
// return app('json')->fail('支付配置为空!');
|
|
|
// }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
//缓存
|
|
|
$redis = \think\facade\Cache::store('redis');
|
|
|
$key = 'show_template_order_sub_' . $request->user['uid'];
|
|
|
@@ -503,7 +495,7 @@ class User extends BaseController
|
|
|
$payMoney = $total_money;//订单需支付费用
|
|
|
$payMoney = $payMoney <= 0 ? 0 : $payMoney;
|
|
|
$nowTime = time();
|
|
|
-
|
|
|
+
|
|
|
//余额支付验证
|
|
|
if($pay_type=="balance" && $payMoney > $request->user["money"]){
|
|
|
return app('json')->fail("当前余额不足");
|
|
|
@@ -521,7 +513,7 @@ class User extends BaseController
|
|
|
$save['status'] = $payMoney <= 0 ? 1 : 0;
|
|
|
$save['pay_time'] = $payMoney <= 0 ? time() : 0;
|
|
|
$save['time'] = $nowTime;
|
|
|
-
|
|
|
+
|
|
|
$save['show_template_id'] = $proData["id"];
|
|
|
$save['show_template_title'] = $proData["title"];;
|
|
|
$save['show_template_price'] = $proData["price"];
|
|
|
@@ -565,16 +557,16 @@ class User extends BaseController
|
|
|
}
|
|
|
//清理之前支付凭证 || 防止重复购买
|
|
|
$payTrade = (new PayTradeModel)
|
|
|
- ->where("uid",$request->user["uid"])
|
|
|
- ->where("o_id",$o_id)
|
|
|
- ->where("type","temp")
|
|
|
- ->where("status",0)
|
|
|
- ->where("time","<",time() - 7*24*60*60)
|
|
|
- ->select()
|
|
|
- ->toArray();
|
|
|
+ ->where("uid",$request->user["uid"])
|
|
|
+ ->where("o_id",$o_id)
|
|
|
+ ->where("type","temp")
|
|
|
+ ->where("status",0)
|
|
|
+ ->where("time","<",time() - 7*24*60*60)
|
|
|
+ ->select()
|
|
|
+ ->toArray();
|
|
|
$wxpay = new wxpayApi();
|
|
|
// $wxpay = new wxpayApi($weixinConfig);
|
|
|
-
|
|
|
+
|
|
|
foreach ($payTrade as $v) {
|
|
|
// if($v['pay_type'] == 'wxpay') {
|
|
|
// $result = $wxpay->closeOrder($v['pay_no']);
|
|
|
@@ -642,10 +634,10 @@ class User extends BaseController
|
|
|
['order_id','','empty','参数错误'],
|
|
|
],$request,true);
|
|
|
$data = (new ShowTemplateOrder)
|
|
|
- ->field("order_id,total_money,all_money,pay_money,status,time")
|
|
|
- ->where("order_id",$order_id)
|
|
|
- ->where("uid",$request->user["uid"])
|
|
|
- ->find();
|
|
|
+ ->field("order_id,total_money,all_money,pay_money,status,time")
|
|
|
+ ->where("order_id",$order_id)
|
|
|
+ ->where("uid",$request->user["uid"])
|
|
|
+ ->find();
|
|
|
if(empty($data)){
|
|
|
return app('json')->fail('信息不存在!');
|
|
|
}
|
|
|
@@ -657,8 +649,8 @@ class User extends BaseController
|
|
|
$data["time"] = date("Y-m-d H:i:s",$data["time"]);
|
|
|
return app('json')->success($data);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 用户模板列表
|
|
|
* @param Request $request
|
|
|
@@ -708,8 +700,8 @@ class User extends BaseController
|
|
|
(new UserShowTemplate)->where("uid", $request->user["uid"])->where("show_template_id", $show_template_id)->update(["is_default" => 1]);
|
|
|
return app('json')->success("设置成功");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 获取邀请海报小程序码
|
|
|
* @param Request $request
|
|
|
@@ -735,8 +727,8 @@ class User extends BaseController
|
|
|
(new UserModel)->where("uid",$request->user["uid"])->update(["invite_img"=>$res["url"]]);
|
|
|
return app('json')->success(["qrcode"=>$res["url"],"bgimg"=>$bgimg]);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
// public function getWxmpInviteQrcode2(Request $request){
|
|
|
//
|
|
|
// //获取小程序码
|
|
|
@@ -811,7 +803,7 @@ class User extends BaseController
|
|
|
// public function checkImgPath(){
|
|
|
//
|
|
|
// }
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 图片合成
|
|
|
* @param type $bg
|
|
|
@@ -819,15 +811,15 @@ class User extends BaseController
|
|
|
* @param type $savePath
|
|
|
*/
|
|
|
public function createPosterImg($bg,$qrcode,$savePath){
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 获取小程序码
|
|
|
* @param Request $request
|
|
|
@@ -845,9 +837,9 @@ class User extends BaseController
|
|
|
}
|
|
|
return app('json')->success(["img"=>$res["data"]]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
- *
|
|
|
+ *
|
|
|
* @param Request $request
|
|
|
*/
|
|
|
public function uploadBase64(Request $request){
|
|
|
@@ -870,14 +862,14 @@ class User extends BaseController
|
|
|
return app('json')->fail($res["msg"]);
|
|
|
}
|
|
|
return app('json')->success(["img"=>$res["data"]]);
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 图片上传
|
|
|
* @param Request $request
|
|
|
@@ -895,7 +887,7 @@ class User extends BaseController
|
|
|
if(!empty($size) && $size>$uploadConfig["image"]["size"]*1024*1024){
|
|
|
return app('json')->fail("图片不能超过{$uploadConfig["image"]["size"]}M");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(!in_array($code, $uploadConfig['image']['path'])){
|
|
|
return app('json')->fail("上传路径错误");
|
|
|
}
|
|
|
@@ -911,7 +903,7 @@ class User extends BaseController
|
|
|
$imgUrl = str_replace("\\", "/", $savePath);
|
|
|
return app('json')->success(['img'=>$imgUrl,'size'=>$size]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 视频上传
|
|
|
* @param Request $request
|
|
|
@@ -940,7 +932,7 @@ class User extends BaseController
|
|
|
$imgUrl = str_replace("\\", "/", $savePath);
|
|
|
return app('json')->success(['video'=>$imgUrl]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* base64文件上传
|
|
|
* @param type $code
|
|
|
@@ -969,8 +961,8 @@ class User extends BaseController
|
|
|
}
|
|
|
return ["code"=>-1,"msg"=>"上传目录不存在"];
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
//重名文件验证
|
|
|
if (is_file($filePath)) {
|
|
|
return ["code"=>-1,"msg"=>"文件已存在"];
|
|
|
@@ -988,14 +980,14 @@ class User extends BaseController
|
|
|
@unlink($filePath);
|
|
|
return ["code"=>1,"url"=>str_replace("\\", "/", $img_url['url'])];
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
$savePath = $sysData['system_url'].config('filesystem.disks.resource.url').DIRECTORY_SEPARATOR.$hashName;
|
|
|
return ["code"=>1,"url"=>str_replace("\\", "/", $savePath)];
|
|
|
}
|
|
|
-
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 七牛上传图片
|
|
|
* @param Request $request
|
|
|
@@ -1027,7 +1019,7 @@ class User extends BaseController
|
|
|
@unlink($rootTmp);
|
|
|
return app('json')->success(['img' => $img_url['url']]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 七牛上传token
|
|
|
* @param Request $request
|