Browse Source

优化商品后台分类代码

antshop
linyaostalker 5 years ago
parent
commit
a331ef2575
  1. 5
      backend/modules/goods/controllers/CategoryController.php

5
backend/modules/goods/controllers/CategoryController.php

@ -201,10 +201,7 @@ class CategoryController extends Controller
$model->user_id = Yii::$app->user->identity->id;
$model->name = $file_name;
$file_manager = new \backend\modules\file\logic\file\FileManager();
$type_res = $file_manager->searchType(\backend\modules\file\logic\file\FileManager::$extension, pathinfo($data['path'])['extension']);
if ($type_res['status']) {
$model->type = $type_res['type'];
}
$model->type = $file_manager->searchType(pathinfo($data['path'])['extension']);
$model->alias = $data['alias'];
$model->path = $data['path'];
$model->save();

Loading…
Cancel
Save