feat: 修正了用户订单中默认地址的获取逻辑,并添加了地址创建时间的记录。

This commit is contained in:
mkm 2024-07-23 15:45:37 +08:00
parent 9560b4f2be
commit d1e7124518
2 changed files with 3 additions and 1 deletions

View File

@ -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'] != '')) {

View File

@ -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;