|
@@ -326,7 +326,7 @@ class ContractServer
|
|
|
private function commonProportion(Contract $contract){
|
|
|
$commonMoney=round(($contract->{'money'}-$contract->{'platform_money'})*$contract->{'common_proportion'}/100,6);
|
|
|
$openSys=CommonServer::creatServer()->getConfigValue('open_sys');
|
|
|
- if($openSys){
|
|
|
+ if($openSys && $commonMoney>0){
|
|
|
$commonAddress=CommonServer::creatServer()->getConfigValue('common_address');
|
|
|
if(empty($commonAddress)){
|
|
|
$this->addDistribution($contract->{'id'},$contract->{'m_id'},0,$commonMoney,5,0,'',$contract->{'common_proportion'},0,'公排分账,无收款地址信息。系统关闭');
|
|
@@ -347,7 +347,7 @@ class ContractServer
|
|
|
private function sedimentProportion(Contract $contract){
|
|
|
$sedimentMoney=round(($contract->{'money'}-$contract->{'platform_money'})*$contract->{'sediment_proportion'}/100,6);
|
|
|
$openSys=CommonServer::creatServer()->getConfigValue('open_sys');
|
|
|
- if($openSys){
|
|
|
+ if($openSys && $sedimentMoney>0){
|
|
|
$sedimentAddress=CommonServer::creatServer()->getConfigValue('sediment_address');
|
|
|
if(empty($sedimentAddress)){
|
|
|
$this->addDistribution($contract->{'id'},$contract->{'m_id'},0,$sedimentMoney,6,0,'',$contract->{'sediment_proportion'},0,'沉淀分账,无收款地址信息。系统关闭');
|
|
@@ -367,9 +367,14 @@ class ContractServer
|
|
|
$agencyMoney=round(($contract->{'money'}-$contract->{'platform_money'})*$contract->{'agency_proportion'}/100,6);
|
|
|
$exchangeMoney=CommonServer::creatServer()->getConfigValue('exchange_money');
|
|
|
$dbMoney=$agencyMoney*$exchangeMoney;
|
|
|
- $member=Member::where('id',$contract->{'m_id'})->select(['id','address','is_boss'])->first();
|
|
|
- $this->addDistribution($contract->{'id'},$contract->{'m_id'},$dbMoney,0,7,$member->{'id'},$member->{'address'},$contract->{'agency_proportion'},1,'代币分账');
|
|
|
- MoneyDetailServer::creatServer()->write(1,1,$dbMoney,1,$member->{'id'},'报单代币清分',$contract->{'id'});
|
|
|
+ if($agencyMoney>0){
|
|
|
+ $member=Member::where('id',$contract->{'m_id'})->select(['id','address','is_boss'])->first();
|
|
|
+ $this->addDistribution($contract->{'id'},$contract->{'m_id'},$dbMoney,0,7,$member->{'id'},$member->{'address'},$contract->{'agency_proportion'},1,'代币分账');
|
|
|
+ MoneyDetailServer::creatServer()->write(1,1,$dbMoney,1,$member->{'id'},'报单代币清分',$contract->{'id'});
|
|
|
+ }else{
|
|
|
+ $this->addContractLog($contract,'代币价格为0,不分发');
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|