更新代码,完善功能
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user