setUploadPath('editor/'.date('Ymd'))->image('upfile'); if(is_array($res)){ SystemAttachmentModel::attachmentAdd($res['name'],$res['size'],$res['type'],$res['dir'],$res['thumb_path'],0,$res['image_type'],$res['time']); $info["originalName"] = $res['name']; $info["name"] = $res['name']; $info["url"] = $res['dir']; $info["size"] = $res['size']; $info["type"] = $res['type']; $info["state"] = "SUCCESS"; if($res['image_type'] == 1) $info['url'] = sysConfig('site_url').str_replace('\\','/',$res['dir']); }else $info = array( "msg" => $res, "state" => "ERROR" ); echo json_encode($info); } }