feat: 修正了用户订单中默认地址的获取逻辑,并添加了地址创建时间的记录。
This commit is contained in:
parent
9560b4f2be
commit
d1e7124518
@ -229,7 +229,7 @@ class OrderLogic extends BaseLogic
|
|||||||
$store_id = getenv('STORE_ID') ?? 1;
|
$store_id = getenv('STORE_ID') ?? 1;
|
||||||
$store['near_store'] = SystemStore::where('id', $store_id)->field('id,name,phone,address,detailed_address,latitude,longitude')->find() ?? [];
|
$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 (empty($store_check)) {
|
||||||
if ((isset($params['lat']) && $params['lat'] != '') && (isset($params['long']) && $params['long'] != '')) {
|
if ((isset($params['lat']) && $params['lat'] != '') && (isset($params['long']) && $params['long'] != '')) {
|
||||||
|
@ -43,6 +43,8 @@ class AddressLogic extends BaseLogic
|
|||||||
'brigade' => $params['brigade'],
|
'brigade' => $params['brigade'],
|
||||||
'detail' => '',
|
'detail' => '',
|
||||||
'is_default' => $params['is_default'],
|
'is_default' => $params['is_default'],
|
||||||
|
'create_time' => time(),
|
||||||
|
'update_time' => time(),
|
||||||
]);
|
]);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return $id;
|
return $id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user