From 7f2de25346a797b07c679ba246103012de7318f2 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Tue, 12 Jul 2022 15:43:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=95=86=E5=93=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=97=A0=E8=A7=84=E6=A0=BC=E5=88=97=E8=A1=A8=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/WarehouseGoodsService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/service/WarehouseGoodsService.php b/app/service/WarehouseGoodsService.php index 39d8789aa..54bb30a8d 100644 --- a/app/service/WarehouseGoodsService.php +++ b/app/service/WarehouseGoodsService.php @@ -43,7 +43,7 @@ class WarehouseGoodsService $n = isset($params['n']) ? intval($params['n']) : 10; $order_by = empty($params['order_by']) ? 'wg.id desc' : trim($params['order_by']); - $data = Db::name('WarehouseGoods')->alias('wg')->join('warehouse_goods_spec wgs', 'wg.id=wgs.warehouse_goods_id')->field($field)->where($where)->group('wg.id')->order($order_by)->limit($m, $n)->select()->toArray(); + $data = Db::name('WarehouseGoods')->alias('wg')->leftJoin('warehouse_goods_spec wgs', 'wg.id=wgs.warehouse_goods_id')->field($field)->where($where)->group('wg.id')->order($order_by)->limit($m, $n)->select()->toArray(); return DataReturn('处理成功', 0, self::DataHandle($data)); } @@ -166,7 +166,7 @@ class WarehouseGoodsService */ public static function WarehouseGoodsTotal($where = []) { - return (int) Db::name('WarehouseGoods')->alias('wg')->join('warehouse_goods_spec wgs', 'wg.id=wgs.warehouse_goods_id')->where($where)->count('distinct wg.id'); + return (int) Db::name('WarehouseGoods')->alias('wg')->leftJoin('warehouse_goods_spec wgs', 'wg.id=wgs.warehouse_goods_id')->where($where)->count('distinct wg.id'); } /**