功能更新
This commit is contained in:
@@ -83,10 +83,34 @@ class Config extends Model {
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getThemesList(){
|
||||
public function getThemesList($request){
|
||||
return [
|
||||
'pc' => [],
|
||||
'mobile' => []
|
||||
'pc' => $this->getList('pc'),
|
||||
'mobile' => $this->getList('mobile')
|
||||
];
|
||||
}
|
||||
|
||||
protected function getList($type){
|
||||
$tempPath = app()->getRootPath() . 'public' . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR;
|
||||
|
||||
$file = opendir($tempPath);
|
||||
$list = [];
|
||||
while (false !== ($filename = readdir($file))) {
|
||||
if (!in_array($filename, array('.', '..'))) {
|
||||
$files = $tempPath . $filename . '/info.php';
|
||||
if (is_file($files)) {
|
||||
$info = include($files);
|
||||
if (isset($info['type']) && $info['type'] == $type) {
|
||||
$info['id'] = $filename;
|
||||
$preview = '/template/' . $filename . '/' . $info['preview'];
|
||||
$info['preview'] = is_file($tempPath . $preview) ? $preview : '/static/common/images/default.png';
|
||||
$list[] = $info;
|
||||
}else{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user