From 1e4e85e0223d9e64213dde9f11fd890e15d30d26 Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Mon, 9 Oct 2023 17:53:18 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/app/admin/controller/goods/Goods.php | 10 ++++++---- server/app/admin/view/goods/goods/lists.html | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/app/admin/controller/goods/Goods.php b/server/app/admin/controller/goods/Goods.php index 9e526125..d177a3e9 100644 --- a/server/app/admin/controller/goods/Goods.php +++ b/server/app/admin/controller/goods/Goods.php @@ -186,6 +186,7 @@ class Goods extends AdminBase $fieldsArr = [ 'ID' => 'string', '商品名称' => 'string', + '商品编码' => 'string', '商家名称' => 'string', '单位' => 'string', '品牌' => 'string', @@ -232,15 +233,15 @@ class Goods extends AdminBase // ->leftJoin('goods_item gi', 'gi.goods_id = g.id') // 先注释 不关联查询sku 否则非常慢 ->where($where)->count(); - if ($total > 10000) { - return JsonServer::error('导出条数不能超过1W条'); + if ($total > 100000) { + return JsonServer::error('导出条数不能超过10W条'); } if ($total == 0) { return JsonServer::error('没有符合条件的数据'); } - $fieldRaw = "g.id as id, g.name as name,s.name as shop_name,gu.name as unit_name,gb.name as brand_name, + $fieldRaw = "g.id as id, g.name as name,g.code,s.name as shop_name,gu.name as unit_name,gb.name as brand_name, gc1.name as first_cate_name,gc2.name as second_cate_name,gc3.name as third_cate_name, g.image,g.content,g.status,g.sales_actual,g.max_price,g.min_price,g.stock,g.audit_status,g.custom_params "; @@ -258,7 +259,7 @@ class Goods extends AdminBase $cursor = $query ->where($where) - ->limit(10000) + ->limit(100000) ->fieldRaw($fieldRaw) ->group('g.id') ->cursor(); @@ -267,6 +268,7 @@ class Goods extends AdminBase $row = []; $row[] = (string)$item['id']; $row[] = $item['name']; + $row[] = $item['code']; $row[] = $item['shop_name']; $row[] = $item['unit_name']; $row[] = $item['brand_name']; diff --git a/server/app/admin/view/goods/goods/lists.html b/server/app/admin/view/goods/goods/lists.html index d6994420..6b227402 100644 --- a/server/app/admin/view/goods/goods/lists.html +++ b/server/app/admin/view/goods/goods/lists.html @@ -14,7 +14,7 @@
*平台审核商家发布的商品,当商品审核通过并且处于销售中状态时,商家可以销售该商品
*平台可通过“违规重审”,下架违规商品并标记为审核未通过。
-*商品导出说明:点击导出按钮时,1. 若有手动勾选则导出勾选记录 2.没有手动勾选则导出符合筛选条件的所有记录 最大导出条数不超过1w条
+*商品导出说明:点击导出按钮时,1. 若有手动勾选则导出勾选记录 2.没有手动勾选则导出符合筛选条件的所有记录 最大导出条数不超过10w条