更新代码,完善功能

This commit is contained in:
2020-02-18 14:50:57 +08:00
parent 31fd944b9c
commit 8bc0f7534b
36 changed files with 283 additions and 280 deletions

View File

@@ -11,7 +11,7 @@ namespace app\controller\admin;
use app\model\Category as CategoryM;
use app\model\Attribute;
use app\model\Module;
use app\model\Model;
use app\controller\Admin;
/**
@@ -28,7 +28,7 @@ class Category extends Admin {
/**
* @title 栏目列表
*/
public function index(CategoryM $category, Attribute $attr, Module $medule) {
public function index(CategoryM $category, Attribute $attr, Model $model) {
$param = $this->request->param();
$map = [];
@@ -42,8 +42,8 @@ class Category extends Admin {
$tree = new \sent\tree\Tree();
$list = $tree->toFormatTree($list->toArray());
}
// $subsql = $attr->where('name', 'category_id')->fetchSql(true)->column('model_id');
// $model_list = $medule->where('id IN ('. $subsql.')')->select();
$subsql = $attr->where('name', 'category_id')->fetchSql(true)->column('model_id');
$model_list = $model->where('id IN ('. $subsql.')')->select();
$this->data = [
'tree' => $list,