Commit 6a239cea authored by hujun's avatar hujun

图片路径修改

parent 088c36fe
......@@ -278,21 +278,17 @@ class Shop extends Basic
$file = request()->file('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);
if($info){
// if ($this->userId) {
// $user_data = $this->gHousesImgModel->field('img_name')->where('id',$this->agentId)->find();
// @unlink($path.DS.$user_data->user_pic); //删除原来的图片
$img_path = $info->getSaveName(); //生成的图片路径
$data['status'] = 200;
$data['msg'] = '上传成功';
$data['data'] = [
'file_name' => CK_IMG_URL .'images'. DS .'app_housesFile'. DS . $img_path,
'save_path' => 'app_housesFile/'.$img_path
];
// }
$img_path = $info->getSaveName(); //生成的图片路径
$data['status'] = 200;
$data['msg'] = '上传成功';
$data['data'] = [
'file_name' => CK_IMG_URL .'images'. DS . $img_path,
'save_path' => $img_path
];
}else{
// 上传失败获取错误信息
$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