From 0d7c31672603c7700ef8128b8bc297cff79ef43f Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Thu, 17 Oct 2024 15:44:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=95=86=E5=AE=B6=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/LocalStoreLogic.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/api/logic/LocalStoreLogic.php b/app/api/logic/LocalStoreLogic.php index 6df48c4d..4e909eed 100644 --- a/app/api/logic/LocalStoreLogic.php +++ b/app/api/logic/LocalStoreLogic.php @@ -442,12 +442,17 @@ class LocalStoreLogic extends Logic public static function orderList($post) { - $s = ""; + $where = []; if (isset($post['state'])) { - $s = "state= " . $post['state'] . ""; + $where[] = ['state', '=', $post['state']]; } + + if (isset($post['keyword'])) { + $where[] = ['order_no', 'like', '%'. $post['keyword'] . '%']; + } + $list = LocalGoodsStore::where('lstore_id', $post['lstore_id']) - ->where($s) + ->where($where) ->where("state <> 3") ->page($post['page_no'], $post['page_size']) ->order('dtime desc') @@ -473,7 +478,7 @@ class LocalStoreLogic extends Logic $list[$key]['local_msg'] = $local; } $count = LocalGoodsStore::where('lstore_id', $post['lstore_id']) - ->where($s) + ->where($where) ->where("state <> 3") ->count(); $all_count = LocalGoodsStore::where('lstore_id', $post['lstore_id'])