diff --git a/app/common/repositories/system/merchant/FinancialRecordRepository.php b/app/common/repositories/system/merchant/FinancialRecordRepository.php index c40db0c7..1904d836 100644 --- a/app/common/repositories/system/merchant/FinancialRecordRepository.php +++ b/app/common/repositories/system/merchant/FinancialRecordRepository.php @@ -120,6 +120,22 @@ class FinancialRecordRepository extends BaseRepository $brokerage_ = $this->dao->search($where)->where('financial_type', 'in', ['brokerage_one', 'brokerage_two'])->sum('number'); $_brokerage = $this->dao->search($where)->where('financial_type', 'in', ['refund_brokerage_two', 'refund_brokerage_one'])->sum('number'); $brokerage = bcsub($brokerage_, $_brokerage, 2); + + //入口店铺佣金 + $entry_merchant=$this->dao->search($where)->where('financial_type', 'commission_to_entry_merchant')->sum('number'); + $entry_merchant_refund=$this->dao->search($where)->where('financial_type', 'commission_to_entry_merchant_refund')->sum('number'); + //云仓库佣金 + $cloud_warehouse=$this->dao->search($where)->where('financial_type', 'commission_to_cloud_warehouse')->sum('number'); + $cloud_warehouse_refund=$this->dao->search($where)->where('financial_type', 'commission_to_cloud_warehouse_refund')->sum('number'); + //服务团队佣金 + $service_team=$this->dao->search($where)->where('financial_type', 'commission_to_service_team')->sum('number'); + $service_team_refund=$this->dao->search($where)->where('financial_type', 'commission_to_service_team_refund')->sum('number'); + //村团队佣金 + $village=$this->dao->search($where)->where('financial_type', 'commission_to_village')->sum('number'); + $village_refund=$this->dao->search($where)->where('financial_type', 'commission_to_village_refund')->sum('number'); + //镇佣金 + $town=$this->dao->search($where)->where('financial_type', 'commission_to_town')->sum('number'); + $town_refund=$this->dao->search($where)->where('financial_type', 'commission_to_town_refund')->sum('number'); //平台手续费 $charge_ = $this->dao->search($where)->where('financial_type', 'in', ['order_charge', 'presell_charge'])->sum('number'); $_charge = $this->dao->search($where)->where('financial_type', 'refund_charge')->sum('number'); @@ -192,7 +208,37 @@ class FinancialRecordRepository extends BaseRepository 'count' => $coupon, 'field' => '元', 'name' => '优惠券金额' - ] + ],[ + 'className' => 'el-icon-s-order', + 'count' => bcsub($entry_merchant,$entry_merchant_refund,2), + 'field' => '元', + 'name' => '入口商户佣金' + ],[ + 'className' => 'el-icon-s-order', + 'count' => bcsub($cloud_warehouse,$cloud_warehouse_refund,2), + 'field' => '元', + 'name' => '云仓库佣金' + ],[ + 'className' => 'el-icon-s-order', + 'count' => bcsub($service_team,$service_team_refund,2), + 'field' => '元', + 'name' => '小组服务佣金' + ],[ + 'className' => 'el-icon-s-order', + 'count' => bcsub($village,$village_refund,2), + 'field' => '元', + 'name' => '村佣金' + ],[ + 'className' => 'el-icon-s-order', + 'count' => bcsub($town,$town_refund,2), + 'field' => '元', + 'name' => '镇佣金' + ],[ + 'className' => 'el-icon-s-order', + 'count' =>bcsub($charge, bcadd(bcadd(bcadd($entry_merchant, $cloud_warehouse, 2), $service_team, 2), $village, 2), 2), + 'field' => '元', + 'name' => '平台剩余手续费' + ], ]; return compact('stat'); }