Improve category selection in goods management - Simplify HTML structure and recommend a concise coding method for

category selection in both add and edit pages of the mall goods module.
- Modify the corresponding JS file to support the new category display format.
- Refactor controller code to assign categories using a more efficient method.
- Ensure consistent category data processing across all related views.

Note: This change updates the way categories are presented to the admin user,
enhancing usability and maintainability of the goods management system.
This commit is contained in:
wolfcode
2024-06-20 10:23:27 +08:00
parent 88035326a4
commit 5855a97255
6 changed files with 37 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
namespace app\admin\controller\mall;
use app\admin\model\MallCate;
use app\admin\model\MallGoods;
use app\common\controller\AdminController;
use app\admin\service\annotation\ControllerAnnotation;
@@ -25,6 +26,7 @@ class Goods extends AdminController
{
parent::__construct($app);
$this->model = new MallGoods();
$this->assign('cate', (new MallCate())->column('title', 'id'));
}
/**