Browse Source

no message

BF-202210271038\Administrator 2 years ago
parent
commit
f2ee84a277

+ 2 - 0
app/Console/Commands/ContractCommand.php

@@ -45,6 +45,8 @@ class ContractCommand extends Command
             if ($num <= 0) {
                 $this->error('---------------执行休眠了---------------------');
                 sleep(3);
+            }else{
+                sleep(1);
             }
             $this->info('---------------执行完成了---------------------'.date('Y-m-d H:i:s'));
         }

+ 2 - 0
app/Console/Commands/GetCommand.php

@@ -47,6 +47,8 @@ class GetCommand extends Command
             if ($num <= 0) {
                 $this->error('---------------执行休眠了---------------------');
                 sleep(3);
+            }else{
+                sleep(1);
             }
             $this->info('---------------执行完成了---------------------'.date('Y-m-d H:i:s'));
         }

+ 2 - 0
app/Console/Commands/SendCommand.php

@@ -106,6 +106,8 @@ class SendCommand extends Command
             if ($num <= 0) {
                 $this->error('---------------执行休眠了---------------------');
                 sleep(3);
+            }else{
+                sleep(1);
             }
             $this->info('---------------执行完成了---------------------'.date('Y-m-d H:i:s'));
         }

+ 4 - 3
app/Http/Controllers/Api/CommonController.php

@@ -34,14 +34,15 @@ class CommonController extends FrontController
 
     function index()
     {
-//        $data=Address::generate();
-        $key='a4bdfb7ca1f44358806d5c291e20a815864360d1b8915273777aa3e22f4379d4';
+        $data=Address::generate();
+//        $key='a4bdfb7ca1f44358806d5c291e20a815864360d1b8915273777aa3e22f4379d4';
+        $key=$data['key'];
         dump($key);
         $key=PassServer::creatServer()->setSecretKey($key);
         dump($key);
 //        dump($data['key']);
         dump(PassServer::creatServer()->getSecretKey($key));
-//        dd($data);
+        dd($data);
     }
 
 

+ 2 - 1
app/Servers/BroadcastServer.php

@@ -100,6 +100,7 @@ class BroadcastServer
                     $update_info['end_time'] = time();
                     $distribution->update(['status' => 3]);
                 }
+                $value->update($update_info);
             }
         }
         return $list->count();
@@ -117,7 +118,7 @@ class BroadcastServer
             if(env('TEST_SERVE')){
                 $value->{'money'}='0.00001';
             }
-            if(empty($bnbNum) || $bnbNum<($value->{'money'}+0.0004)){
+            if((empty($bnbNum) || $bnbNum<($value->{'money'}+0.0004)) && !env('TEST_SERVE')){
                 $transaction['end_time'] = time();
             }else{
                 //ETH广播

+ 10 - 5
app/Servers/ContractServer.php

@@ -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,不分发');
+        }
+
     }
 
     /**

+ 1 - 1
app/Servers/Icon/Utils.php

@@ -227,7 +227,7 @@ class Utils
         $decval = '0';
         $number = strrev($number);
         for ($i = 0; $i < strlen($number); $i++) {
-            $decval = bcadd(bcmul(bcpow('16', $i, 0), $decvalues[$number{$i}]), $decval);
+            $decval = bcadd(bcmul(bcpow('16', $i, 0), $decvalues[$number[$i]]), $decval);
         }
         return $decval;
     }

+ 1 - 2
app/Servers/MemberLogsServer.php

@@ -20,8 +20,7 @@ class MemberLogsServer
         if('common.base64'==request()->route()->getName()){
             return  1;
         }
-        $m_id=request()->input('m_id','0');
-        if(empty($m_id) || !is_numeric($m_id))$m_id=0;
+        $m_id=empty(request()->member['m_id'])?:0;
         $url = request()->url();
         $token=request()->header('Authorization');
         if(empty($token)){