Commit 6a239cea authored by hujun's avatar hujun

图片路径修改

parent 088c36fe
...@@ -278,21 +278,17 @@ class Shop extends Basic ...@@ -278,21 +278,17 @@ class Shop extends Basic
$file = request()->file('file'); $file = request()->file('file');
if($file){ if($file){
$path = ROOT_PATH . 'public' . DS . 'resource'. DS . 'lib'. DS .'Attachments'. DS .'images'. DS . 'app_housesFile'; $path = ROOT_PATH . 'public' . DS . 'resource'. DS . 'lib'. DS .'Attachments'. DS .'images';
$info = $file->validate(['size'=>1024000,'ext'=>'jpg,png'])->move($path); $info = $file->validate(['size'=>1024000,'ext'=>'jpg,png'])->move($path);
if($info){ if($info){
// if ($this->userId) { $img_path = $info->getSaveName(); //生成的图片路径
// $user_data = $this->gHousesImgModel->field('img_name')->where('id',$this->agentId)->find();
// @unlink($path.DS.$user_data->user_pic); //删除原来的图片 $data['status'] = 200;
$img_path = $info->getSaveName(); //生成的图片路径 $data['msg'] = '上传成功';
$data['data'] = [
$data['status'] = 200; 'file_name' => CK_IMG_URL .'images'. DS . $img_path,
$data['msg'] = '上传成功'; 'save_path' => $img_path
$data['data'] = [ ];
'file_name' => CK_IMG_URL .'images'. DS .'app_housesFile'. DS . $img_path,
'save_path' => 'app_housesFile/'.$img_path
];
// }
}else{ }else{
// 上传失败获取错误信息 // 上传失败获取错误信息
$data['msg'] = $file->getError(); $data['msg'] = $file->getError();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment