Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
aimeiyue
service
Commits
63dbf8f4
Commit
63dbf8f4
authored
Nov 13, 2025
by
yink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复代收点经纬度参数错误并添加日志记录
修复前端传递的经纬度参数错误问题,将lat和lng参数互换位置 在商品库存更新和距离计算中添加日志记录 更新代购产品表单提示信息 优化订单控制器注释说明
parent
a1a99506
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
5 deletions
+14
-5
app/Admin/Controllers/GoodController.php
+1
-1
app/Http/Controllers/Api/OrderController.php
+2
-1
app/Http/Controllers/Api/StoreController.php
+4
-3
app/Models/Adapay.php
+7
-0
No files found.
app/Admin/Controllers/GoodController.php
View file @
63dbf8f4
...
...
@@ -186,7 +186,7 @@ protected function form()
->
limit
(
9
)
->
autoUpload
()
->
saveAsJson
();
$form
->
switch
(
'is_show'
,
'上架状态'
)
->
default
(
1
);
$form
->
switch
(
'goods_type'
,
'是否代购产品'
)
->
default
(
0
);
$form
->
switch
(
'goods_type'
,
'是否代购产品
(代购才会有代购价)
'
)
->
default
(
0
);
$form
->
switch
(
'is_hot'
,
'是否推荐'
)
->
default
(
0
);
$form
->
text
(
'sort'
,
'排序'
)
->
default
(
0
)
->
help
(
'越大越靠前'
);
$form
->
disableCreatingCheck
();
...
...
app/Http/Controllers/Api/OrderController.php
View file @
63dbf8f4
...
...
@@ -26,7 +26,7 @@
class
OrderController
extends
BaseController
{
//立即购买-确认订单【
好像没什么用
】
//立即购买-确认订单【
提供前端一些订单信息
】
public
function
CheckoutBuyOrder
(
Request
$request
)
{
$userObj
=
$request
->
user
();
...
...
@@ -51,6 +51,7 @@ public function CheckoutBuyOrder(Request $request)
$goods_price
=
(
$arrObj
&&
$goodsObj
->
goods_type
&&
$merchant_id
)
?
$arrObj
->
cg_price
:
$arrObj
->
market_price
;
}
$data
=
[];
$data
[
'goods_id'
]
=
$goods_id
;
$data
[
'goods_name'
]
=
$goodsObj
->
goods_name
;
...
...
app/Http/Controllers/Api/StoreController.php
View file @
63dbf8f4
...
...
@@ -20,9 +20,10 @@ public function getList()
//代收点列表
public
function
getDeliveryList
(
Request
$request
)
{
//疑似前端搞返了这两个值,外包前端,改完还要提审,不找他算了直接用
$mid
=
$request
->
user
()
->
merchant_id
;
$lat1
=
$request
->
l
at
??
''
;
$lng1
=
$request
->
l
ng
??
''
;
$lat1
=
$request
->
l
ng
??
''
;
$lng1
=
$request
->
l
at
??
''
;
$list
=
[];
if
(
$mid
)
{
$list
=
Store
::
where
([
'merchant_id'
=>
$mid
])
...
...
@@ -97,7 +98,7 @@ public function testHaversineDistance(Request $request)
function
haversineDistance
(
$lat1
,
$lng1
,
$lat2
,
$lng2
)
{
Log
::
info
([
'lat1'
=>
$lat1
,
'lng1'
=>
$lng1
,
'lat2'
=>
$lat2
,
'lng2'
=>
$lng2
]);
// 地球半径(单位:千米)
$radius
=
6371
;
...
...
app/Models/Adapay.php
View file @
63dbf8f4
...
...
@@ -750,6 +750,13 @@ public static function updateGoodsStock($orderObj, $isIncreaseStock = false)
'merchant_id'
=>
$orderObj
->
merchant_id
])
->
first
();
// Log::add('更新商品规格库存', [
// 'mgsObj' => $mgsObj,
// 'merchant_id' => $orderObj->merchant_id,
// 'isIncreaseStock' => $isIncreaseStock,
// ]);
// 如果订单有商户ID且找到对应的商户规格库存记录,则更新商户规格库存
if
(
$orderObj
->
merchant_id
&&
$mgsObj
)
{
// 根据参数决定是增加还是减少库存
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment