//创建目录
private function createDir($str)
{
$path = date('Ymd');
$str= \Yii::getAlias(\Yii::$app->params['attached.path']) . 'public/aging_img/' . $path;
$paths = __FILE__;
$paths = str_replace("\\",'/',$paths);
$arr = explode('/', $paths);
$stutes = 1;
$path = '';
foreach ($arr as $key=>$it){
if($it != "apps" && $stutes != 2){
if($key == 0){
$path = $it;
}else{
$path .= '/'.$it;
}
}
if($it == "apps"){
$stutes = 2;
}
}
$path .= $str;
if(!is_dir($path)){
mkdir($path,0777,true);
}
return $path;
}