From d1357fc65909a16391e3a8917feeeaf4f63a54b9 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 26 Aug 2024 11:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A1=E6=A0=B8=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E7=8A=B6=E6=80=81=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/LocalStoreGoodsLogic.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/api/logic/LocalStoreGoodsLogic.php b/app/api/logic/LocalStoreGoodsLogic.php index c74a850f..387b04eb 100644 --- a/app/api/logic/LocalStoreGoodsLogic.php +++ b/app/api/logic/LocalStoreGoodsLogic.php @@ -11,8 +11,15 @@ use think\facade\Config; class LocalStoreGoodsLogic extends Logic { private static $STATUS = [ - 'shelves' => 1, - 'status_sold_out' => 2 + 'stay' => 0, // 默认 + 'shelves' => 1, // 已上架 + 'status_sold_out' => 2 // 已下架 + ]; + + private static $AUDIT_STATUS = [ + 'audit_status_stay' => 0, // 待审核 + 'audit_status_ok' => 1, // 审核通过 + 'audit_status_refuse' => 2 // 审核失败 ]; // 获取商品列表 @@ -23,6 +30,7 @@ class LocalStoreGoodsLogic extends Logic ->where([ 'lstore_id' => $get['lstore_id'], 'state' => $get['type'], + 'audit_status' => self::$AUDIT_STATUS['audit_status_ok'], 'delete_time' => 0, ]) ->order('id', 'desc') @@ -33,6 +41,7 @@ class LocalStoreGoodsLogic extends Logic $count = LocalStoreGoods::where([ 'lstore_id' => $get['lstore_id'], 'state' => $get['lstore_id'], + 'audit_status' => self::$AUDIT_STATUS['audit_status_ok'], 'delete_time' => 0, ])->count(); @@ -136,13 +145,13 @@ class LocalStoreGoodsLogic extends Logic 'id' => $get['id'], 'lstore_id' => $get['lstore_id'], 'delete_time' => 0, + 'audit_status' => self::$STATUS['audit_status_ok'], ])->find()->toArray(); if ($data) { foreach ($data['pic'] as &$v) { $v['url'] = Config::get('aliyunoss.domain') . $v['url']; } - return $data; }