From d1e71245186ac9b50676663516ceeb19c73d5fd6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 23 Jul 2024 15:45:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=AD=A3=E4=BA=86=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=AE=A2=E5=8D=95=E4=B8=AD=E9=BB=98=E8=AE=A4=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E7=9A=84=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=9C=B0=E5=9D=80=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=97=B6=E9=97=B4=E7=9A=84=E8=AE=B0=E5=BD=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 2 +- app/api/logic/user/AddressLogic.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 1c794315b..eb44a671e 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -229,7 +229,7 @@ class OrderLogic extends BaseLogic $store_id = getenv('STORE_ID') ?? 1; $store['near_store'] = SystemStore::where('id', $store_id)->field('id,name,phone,address,detailed_address,latitude,longitude')->find() ?? []; } - // $order['address_id'] = UserAddress::where('uid', $user['id'])->where('is_default', 1)->value('id'); + $order['address_id'] = UserAddress::where('uid', $user['id'])->where('is_default', 1)->value('id')??0; } if (empty($store_check)) { if ((isset($params['lat']) && $params['lat'] != '') && (isset($params['long']) && $params['long'] != '')) { diff --git a/app/api/logic/user/AddressLogic.php b/app/api/logic/user/AddressLogic.php index 9b54b1692..694c1a16a 100644 --- a/app/api/logic/user/AddressLogic.php +++ b/app/api/logic/user/AddressLogic.php @@ -43,6 +43,8 @@ class AddressLogic extends BaseLogic 'brigade' => $params['brigade'], 'detail' => '', 'is_default' => $params['is_default'], + 'create_time' => time(), + 'update_time' => time(), ]); Db::commit(); return $id;