diff --git a/app/admin/controller/mall/Goods.php b/app/admin/controller/mall/Goods.php index b4dcc0a..10b4b9d 100644 --- a/app/admin/controller/mall/Goods.php +++ b/app/admin/controller/mall/Goods.php @@ -9,11 +9,7 @@ use app\admin\traits\Curd; use app\common\controller\AdminController; use app\admin\service\annotation\ControllerAnnotation; use app\admin\service\annotation\NodeAnotation; -use PhpOffice\PhpSpreadsheet\Cell\Coordinate; -use PhpOffice\PhpSpreadsheet\Spreadsheet; -use PhpOffice\PhpSpreadsheet\Writer\Xlsx; use think\App; -use think\helper\Arr; /** * Class Goods @@ -87,5 +83,14 @@ class Goods extends AdminController $this->assign('row', $row); return $this->fetch(); } - + + public function read($id) + { + + $row = $this->model->find($id); + + $this->assign('row', $row); + + return $this->fetch(); + } } diff --git a/app/admin/model/MallGoods.php b/app/admin/model/MallGoods.php index 3a86c55..0212957 100644 --- a/app/admin/model/MallGoods.php +++ b/app/admin/model/MallGoods.php @@ -15,4 +15,12 @@ class MallGoods extends TimeModel return $this->belongsTo('app\admin\model\MallCate', 'cate_id', 'id'); } -} \ No newline at end of file + public function getTagListTitleAttr() + { + $tags = $this->getAttr('tag'); + + $list_tag = MallTag::whereIn('id', $tags)->column('title'); + + return $list_tag; + } +} diff --git a/app/admin/view/mall/goods/read.html b/app/admin/view/mall/goods/read.html new file mode 100644 index 0000000..8a40057 --- /dev/null +++ b/app/admin/view/mall/goods/read.html @@ -0,0 +1,113 @@ + +