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
6b56fa63
Commit
6b56fa63
authored
Nov 25, 2025
by
yink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(佣金计算): 优化商户佣金计算逻辑并移除冗余条件
修改商户佣金计算方式,增加员工佣金扣除计算 移除评论控制器中不必要的条件判断 清理调试日志代码
parent
6b161ed6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
app/Http/Controllers/Api/CommentController.php
+3
-5
app/Http/Controllers/Api/StoreAdminUsersController.php
+7
-3
No files found.
app/Http/Controllers/Api/CommentController.php
View file @
6b56fa63
...
@@ -49,11 +49,9 @@ public function add(Request $request)
...
@@ -49,11 +49,9 @@ public function add(Request $request)
$count
=
OrderGoods
::
where
(
'order_id'
,
$oid
)
->
where
(
'is_comment'
,
0
)
->
count
();
$count
=
OrderGoods
::
where
(
'order_id'
,
$oid
)
->
where
(
'is_comment'
,
0
)
->
count
();
Log
::
add
(
'订单商品评论'
.
$og_id
,
[
'num'
=>
$count
]);
Log
::
add
(
'订单商品评论'
.
$og_id
,
[
'num'
=>
$count
]);
if
(
$count
==
0
)
{
if
(
$count
==
0
)
{
if
(
$useObj
->
spuid
||
$useObj
->
merchant_id
)
{
$orderObj
->
is_commission
=
1
;
$orderObj
->
is_commission
=
1
;
$orderObj
->
order_status
=
4
;
$orderObj
->
order_status
=
4
;
$orderObj
->
save
();
$orderObj
->
save
();
}
// Log::add('调用分佣', $orderObj->toArray());
// Log::add('调用分佣', $orderObj->toArray());
// $this->dispatch(new AutoCompleteOrder($orderObj, 10));
// $this->dispatch(new AutoCompleteOrder($orderObj, 10));
}
}
...
...
app/Http/Controllers/Api/StoreAdminUsersController.php
View file @
6b56fa63
...
@@ -267,8 +267,12 @@ public static function getCommissionAmount($type, $obj_id)
...
@@ -267,8 +267,12 @@ public static function getCommissionAmount($type, $obj_id)
log.goods_number,
log.goods_number,
-- 计算总的商品价格
-- 计算总的商品价格
COALESCE(log.goods_number*log.goods_price, 0) AS total_price,
COALESCE(log.goods_number*log.goods_price, 0) AS total_price,
-- 计算总的商户佣金
-- 计算总的商户佣金()
COALESCE((log.goods_number*log.goods_price * lg.merchant_commission)/100, 0) AS total_merchant_commission,
COALESCE(
ROUND(((log.goods_price * lg.merchant_commission * 1.0) / 100) - ((log.goods_price * lg.merchant_commission * sau.employee_commission) / 10000), 2),
ROUND(((log.goods_price * lg.merchant_commission * 1.0) / 100) , 2)
) AS total_merchant_commission,
-- 计算总的商户员工佣金
-- 计算总的商户员工佣金
COALESCE((log.goods_number * log.goods_price * lg.merchant_commission * sau.employee_commission) / 10000, 0) AS total_employee_commission
COALESCE((log.goods_number * log.goods_price * lg.merchant_commission * sau.employee_commission) / 10000, 0) AS total_employee_commission
FROM
FROM
...
@@ -318,7 +322,7 @@ public static function getCommissionAmount($type, $obj_id)
...
@@ -318,7 +322,7 @@ public static function getCommissionAmount($type, $obj_id)
in (
in (
select user_id from store_employee_user_rec where employee_id=?
select user_id from store_employee_user_rec where employee_id=?
); '
,
[
$obj_id
,
$obj_id
]);
); '
,
[
$obj_id
,
$obj_id
]);
Log
::
add
(
'zhu3'
,
$obj_id
);
//
Log::add('zhu3',$obj_id);
}
}
//遍历列表,计算实际佣金
//遍历列表,计算实际佣金
...
...
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