From 4350e5f29454c4b13f5605ed35c0582d9001bd8b Mon Sep 17 00:00:00 2001 From: augushong Date: Fri, 9 Jan 2026 00:02:54 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/test/Goods.php | 104 ---------- app/admin/model/TestGoods.php | 96 --------- app/admin/view/test/goods/_common.js | 11 - app/admin/view/test/goods/add.html | 200 ------------------ app/admin/view/test/goods/add.js | 3 - app/admin/view/test/goods/edit.html | 200 ------------------ app/admin/view/test/goods/edit.js | 3 - app/admin/view/test/goods/index.html | 13 -- app/admin/view/test/goods/index.js | 26 --- app/admin/view/test/goods/read.html | 295 --------------------------- app/admin/view/test/goods/read.js | 22 -- 11 files changed, 973 deletions(-) delete mode 100644 app/admin/controller/test/Goods.php delete mode 100644 app/admin/model/TestGoods.php delete mode 100644 app/admin/view/test/goods/_common.js delete mode 100644 app/admin/view/test/goods/add.html delete mode 100644 app/admin/view/test/goods/add.js delete mode 100644 app/admin/view/test/goods/edit.html delete mode 100644 app/admin/view/test/goods/edit.js delete mode 100644 app/admin/view/test/goods/index.html delete mode 100644 app/admin/view/test/goods/index.js delete mode 100644 app/admin/view/test/goods/read.html delete mode 100644 app/admin/view/test/goods/read.js diff --git a/app/admin/controller/test/Goods.php b/app/admin/controller/test/Goods.php deleted file mode 100644 index 3601754..0000000 --- a/app/admin/controller/test/Goods.php +++ /dev/null @@ -1,104 +0,0 @@ -model = new \app\admin\model\TestGoods(); - - $this->assign('select_list_status', $this->model::SELECT_LIST_STATUS, true); - - $this->assign('select_list_time_status', $this->model::SELECT_LIST_TIME_STATUS, true); - - $this->assign('select_list_is_recommend', $this->model::SELECT_LIST_IS_RECOMMEND, true); - - $this->assign('select_list_shop_type', $this->model::SELECT_LIST_SHOP_TYPE, true); - - } - - - /** - * @NodeAnotation(title="列表") - */ - public function index() - { - if ($this->request->isAjax()) { - if (input('selectFields')) { - return $this->selectList(); - } - list($page, $limit, $where) = $this->buildTableParames(); - $count = $this->model - ->withJoin(['mallCate'], 'LEFT') - ->where($where) - ->count(); - $list = $this->model - ->withJoin(['mallCate'], 'LEFT') - ->where($where) - ->page($page, $limit) - ->order($this->sort) - ->select(); - $data = [ - 'code' => 0, - 'msg' => '', - 'count' => $count, - 'data' => $list, - ]; - return json($data); - } - return $this->fetch(); - } - - - - /** - * @NodeAnotation(title="导出") - */ - public function export() - { - list($page, $limit, $where) = $this->buildTableParames(); - - - $this->model = $this->model->withJoin(['mallCate'], 'LEFT'); - - $fields = $this->request->param('fields', '{}', null); - $image_fields = $this->request->param('image_fields', '{}', null); - $select_fields = $this->request->param('select_fields', '{}', null); - $date_fields = $this->request->param('date_fields', '{}', null); - - $fields = json_decode($fields, true); - $image_fields = json_decode($image_fields, true); - $select_fields = json_decode($select_fields, true); - $date_fields = json_decode($date_fields, true); - - $content = \app\common\tools\ExportTools::excel($this->model, $where, $fields, $image_fields, $select_fields, $date_fields); - - $export_file_name = $this->exportFileName; - - if (empty($export_file_name)) { - $export_file_name = $this->model->getName(); - } - - return download($content, $export_file_name . date('YmdHis') . '.xlsx', true); - } -} \ No newline at end of file diff --git a/app/admin/model/TestGoods.php b/app/admin/model/TestGoods.php deleted file mode 100644 index 49b5126..0000000 --- a/app/admin/model/TestGoods.php +++ /dev/null @@ -1,96 +0,0 @@ - '正常', '1' => '禁用']; - - public const SELECT_LIST_TIME_STATUS = ['0' => '未参加', '1' => '已开始', '3' => '已结束']; - - public const SELECT_LIST_IS_RECOMMEND = ['0' => '不推荐', '1' => '推荐']; - - public const SELECT_LIST_SHOP_TYPE = ['taobao' => '淘宝', 'jd' => '京东']; - - /** - * 商品图片获取器 - * @param $value - * @return array - */ - public function getImagesListAttr($value, $data) - { - if (empty($data['images'])) { - return []; - } - return explode('|', $data['images']); - } - /** - * 检测报告获取器 - * @param $value - * @return array - */ - public function getVerfiyFileListAttr($value, $data) - { - if (empty($data['verfiy_file'])) { - return []; - } - return explode('|', $data['verfiy_file']); - } - /** - * 商品类型获取器 - * @param $value - * @return array - */ - public function getShopTypeListAttr($value, $data) - { - if (empty($data['shop_type'])) { - return []; - } - return explode(',', $data['shop_type']); - } - - - public function mallCate() - { - return $this->belongsTo('\app\admin\model\MallCate', 'cate_id', 'id'); - } - - -} diff --git a/app/admin/view/test/goods/_common.js b/app/admin/view/test/goods/_common.js deleted file mode 100644 index ae3225b..0000000 --- a/app/admin/view/test/goods/_common.js +++ /dev/null @@ -1,11 +0,0 @@ -var init = { - tableElem: '#currentTable', - tableRenderId: 'currentTableRenderId', - indexUrl: 'test.goods/index', - addUrl: 'test.goods/add' + location.search, - editUrl: 'test.goods/edit', - readUrl: 'test.goods/read', - deleteUrl: 'test.goods/delete', - exportUrl: 'test.goods/export', - modifyUrl: 'test.goods/modify', -}; diff --git a/app/admin/view/test/goods/add.html b/app/admin/view/test/goods/add.html deleted file mode 100644 index c034665..0000000 --- a/app/admin/view/test/goods/add.html +++ /dev/null @@ -1,200 +0,0 @@ -
-
- -
- -
-
- -
-
-
-
- -
- -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- {foreach $select_list_status as $k=>$v} - - {/foreach} -
-
- -
- -
- - -
-
-
- -
- - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- {foreach $select_list_is_recommend as $k=>$v} - - {/foreach} -
-
- -
- -
- {foreach $select_list_shop_type as $k=>$v} - - {/foreach} -
-
- -
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- {notempty name='$Request.param.backTagId'} -
返回
- {/notempty} - - -
- -
-
\ No newline at end of file diff --git a/app/admin/view/test/goods/add.js b/app/admin/view/test/goods/add.js deleted file mode 100644 index 4a445e0..0000000 --- a/app/admin/view/test/goods/add.js +++ /dev/null @@ -1,3 +0,0 @@ -$(function(){ - ua.listen(); -}) \ No newline at end of file diff --git a/app/admin/view/test/goods/edit.html b/app/admin/view/test/goods/edit.html deleted file mode 100644 index 634c128..0000000 --- a/app/admin/view/test/goods/edit.html +++ /dev/null @@ -1,200 +0,0 @@ -
-
- -
- -
-
- -
-
-
-
- -
- -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- {foreach $select_list_status as $k=>$v} - - {/foreach} -
-
- -
- -
- - -
-
-
- -
- - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- {foreach $select_list_is_recommend as $k=>$v} - - {/foreach} -
-
- -
- -
- {foreach $select_list_shop_type as $k=>$v} - - {/foreach} -
-
- -
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- {notempty name='$Request.param.backTagId'} -
返回
- {/notempty} - - -
- -
-
\ No newline at end of file diff --git a/app/admin/view/test/goods/edit.js b/app/admin/view/test/goods/edit.js deleted file mode 100644 index 4a445e0..0000000 --- a/app/admin/view/test/goods/edit.js +++ /dev/null @@ -1,3 +0,0 @@ -$(function(){ - ua.listen(); -}) \ No newline at end of file diff --git a/app/admin/view/test/goods/index.html b/app/admin/view/test/goods/index.html deleted file mode 100644 index 9e71a4f..0000000 --- a/app/admin/view/test/goods/index.html +++ /dev/null @@ -1,13 +0,0 @@ -
-
- -
-
-
\ No newline at end of file diff --git a/app/admin/view/test/goods/index.js b/app/admin/view/test/goods/index.js deleted file mode 100644 index 01c9dcc..0000000 --- a/app/admin/view/test/goods/index.js +++ /dev/null @@ -1,26 +0,0 @@ -$(function(){ - ua.table.render({ - init: init, - cols: [[ - {type: 'checkbox'}, {field: 'id', title: 'id'}, {field: 'cate_id', title: '分类ID'}, {field: 'title', title: '商品名称'}, {field: 'logo', title: '商品logo', templet: ua.table.image}, {field: 'total_stock', title: '总库存'}, {field: 'sort', title: '排序', edit: 'text'}, {field: 'status', search: 'select', selectList: ua.getDataBrage('select_list_status'), title: '状态', templet: ua.table.switch}, {field: 'cert_file', title: '合格证', templet: ua.table.url}, {field: 'remark', title: '备注说明', templet: ua.table.text}, {field: 'create_time', title: 'create_time'}, {field: 'publish_time', title: '发布日期'}, {field: 'sale_time', title: '售卖日期'}, {field: 'intro', title: '简介'}, {field: 'time_status', search: 'select', selectList: ua.getDataBrage('select_list_time_status'), title: '秒杀状态'}, {field: 'is_recommend', search: 'select', selectList: ua.getDataBrage('select_list_is_recommend'), title: '是否推荐'}, {field: 'shop_type', search: 'select', selectList: ua.getDataBrage('select_list_shop_type'), title: '商品类型'}, {field: 'from_area', title: '产地'}, {field: 'store_city', title: '仓库'}, {field: 'tag_input', title: '商品标签 (输入)'}, {field: 'uid', title: '唯一id'}, {field: 'price', title: '价格'}, {field: 'detail', title: '详情'}, {field: 'mallCate.id', title: ''}, {field: 'mallCate.title', title: '分类名'}, {field: 'mallCate.image', title: '分类图片', templet: ua.table.image}, {field: 'mallCate.sort', title: '排序', edit: 'text'}, {field: 'mallCate.status', title: '状态', templet: ua.table.switch}, {field: 'mallCate.remark', title: '备注说明', templet: ua.table.text}, {field: 'mallCate.create_time', title: '创建时间'}, { - width: 250, title: '操作', templet: ua.table.tool, fixed: 'right', operat: [ - [{ - class: 'layui-btn layui-btn-primary layui-btn-xs', - method: 'tab', - field: 'id', - text: '详情', - title: '查看详情', - auth: 'read', - url: init.readUrl, - icon: '' - }], - 'edit', - 'delete' - ] - }, - - ]], - }); - - ua.listen(); -}) \ No newline at end of file diff --git a/app/admin/view/test/goods/read.html b/app/admin/view/test/goods/read.html deleted file mode 100644 index 2d6a677..0000000 --- a/app/admin/view/test/goods/read.html +++ /dev/null @@ -1,295 +0,0 @@ -
-
-
-
-
-
-

#{$row.id} {$title}

-
ID: {$row.id}
-
-
- - -
-
-
-
-
- -
-
-
-
分类ID
-
- {notempty name="row.cate_id"} - {$row.cate_id} - {else/} - 暂无数据 - {/notempty} -
-
-
-
商品名称
-
- {notempty name="row.title"} - {$row.title} - {else/} - 暂无数据 - {/notempty} -
-
-
-
商品logo
-
- {notempty name="row.logo"} - - {else/} - 暂无图片 - {/notempty} -
-
-
-
商品图片
-
- {notempty name="row.images_list"} - {volist name="row.images_list" id="img"} - - {/volist} - {else/} - 暂无图片 - {/notempty} -
-
-
-
商品描述
-
- {notempty name="row.describe"} - {$row.describe|raw} - {else/} - 暂无内容 - {/notempty} -
-
-
-
总库存
-
- {notempty name="row.total_stock"} - {$row.total_stock} - {else/} - 暂无数据 - {/notempty} -
-
-
-
合格证
-
- {notempty name="row.cert_file"} - - 下载文件 - -
{$row.cert_file}
- {else/} - 暂无文件 - {/notempty} -
-
-
-
检测报告
-
- {notempty name="row.verfiy_file_list"} - {volist name="row.verfiy_file_list" id="file"} - - {/volist} - {else/} - 暂无文件 - {/notempty} -
-
-
-
备注说明
-
- {notempty name="row.remark"} - {$row.remark|raw} - {else/} - 暂无内容 - {/notempty} -
-
-
-
发布日期
-
- {notempty name="row.publish_time"} - {$row.publish_time|date="Y-m-d H:i:s"} - {else/} - 暂无数据 - {/notempty} -
-
-
-
售卖日期
-
- {notempty name="row.sale_time"} - {$row.sale_time|date="Y-m-d H:i:s"} - {else/} - 暂无数据 - {/notempty} -
-
-
-
简介
-
- {notempty name="row.intro"} - {$row.intro|raw} - {else/} - 暂无内容 - {/notempty} -
-
-
-
秒杀状态
-
- {$select_list_time_status[$row.time_status]|default=''} -
-
-
-
是否推荐
-
- {$select_list_is_recommend[$row.is_recommend]|default=''} -
-
-
-
商品类型
-
- {volist name="row.shop_type_list" id="item"}{$select_list_shop_type[$item]|default=''}{/volist} -
-
-
-
商品标签
-
- {notempty name="row.tag"} - {$row.tag} - {else/} - 暂无数据 - {/notempty} -
-
-
-
商品标签(单选)
-
- {notempty name="row.tag_backup"} - {$row.tag_backup} - {else/} - 暂无数据 - {/notempty} -
-
-
-
产地
-
- {notempty name="row.from_area"} - {$row.from_area} - {else/} - 暂无数据 - {/notempty} -
-
-
-
仓库
-
- {notempty name="row.store_city"} - {$row.store_city} - {else/} - 暂无数据 - {/notempty} -
-
-
-
商品标签 (输入)
-
- {notempty name="row.tag_input"} - {$row.tag_input} - {else/} - 暂无数据 - {/notempty} -
-
-
-
唯一id
-
- {notempty name="row.uid"} - {$row.uid} - {else/} - 暂无数据 - {/notempty} -
-
-
-
价格
-
- {notempty name="row.price"} - {$row.price} - {else/} - 暂无数据 - {/notempty} -
-
-
-
详情
-
- {notempty name="row.detail"} - {$row.detail} - {else/} - 暂无数据 - {/notempty} -
-
- -
-
- -
-

基础信息

-
-
-
ID
-
{$row.id}
-
-
-
排序
-
- {notempty name="row.sort"} - {$row.sort} - {else/} - 暂无数据 - {/notempty} -
-
-
-
状态
-
- {$select_list_status[$row.status]|default=''} -
-
-
-
create_time
-
- {notempty name="row.create_time"} - {$row.create_time} - {else/} - 暂无数据 - {/notempty} -
-
- -
-
-
-
-
-
-
\ No newline at end of file diff --git a/app/admin/view/test/goods/read.js b/app/admin/view/test/goods/read.js deleted file mode 100644 index f5671a7..0000000 --- a/app/admin/view/test/goods/read.js +++ /dev/null @@ -1,22 +0,0 @@ -$(function(){ - // 删除数据 - window.deleteData = function(id) { - layer.confirm('确定要删除这条数据吗?', { - icon: 3, - title: '提示' - }, function(index) { - $.post('{{:url("delete")}}', {id: id}, function(res) { - if (res.code == 0) { - layer.msg('删除成功', {icon: 1}, function() { - location.href = '{{:url("index")}}'; - }); - } else { - layer.msg(res.msg, {icon: 2}); - } - }, 'json'); - layer.close(index); - }); - }; - - ua.listen(); -}) \ No newline at end of file