소스 검색

修改公共方法命名

hefei 1 년 전
부모
커밋
a2e96765da
3개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 2
      app/common.php
  2. 1 1
      app/common/repositories/store/order/StoreOrderRepository.php
  3. 3 3
      app/common/repositories/user/UserThirdRepository.php

+ 2 - 2
app/common.php

@@ -900,13 +900,13 @@ if (!function_exists("is_json")){
900 900
 
901 901
 
902 902
 
903
-if (!function_exists("roundOptimize")){
903
+if (!function_exists("round_optimize")){
904 904
     /**
905 905
      * round公用四舍五入去除
906 906
      * @param $number
907 907
      * @return string
908 908
      */
909
-    function roundOptimize($amount, $decimals = 2): string
909
+    function round_optimize($amount, $decimals = 2): string
910 910
     {
911 911
         if ($amount > 0) {
912 912
             $factor = pow(10, $decimals);

+ 1 - 1
app/common/repositories/store/order/StoreOrderRepository.php

@@ -3827,7 +3827,7 @@ class StoreOrderRepository extends BaseRepository
3827 3827
             $yongjin = $pvfee * $yongjinbili / 100;
3828 3828
 
3829 3829
             // 佣金百分之90进入佣金池  佣金百分之10进入复购金
3830
-            $tuiguanyongjin = roundOptimize($yongjin * 0.9, 2);
3830
+            $tuiguanyongjin = round_optimize($yongjin * 0.9, 2);
3831 3831
             $tuiguanfugou = $yongjin;//复购金赠送函数里面有计算百分之10
3832 3832
 
3833 3833
             //end会费

+ 3 - 3
app/common/repositories/user/UserThirdRepository.php

@@ -847,7 +847,7 @@ class UserThirdRepository extends BaseRepository
847 847
             //判断是否是老用户  is_old=1是1.0的用户,1.0的用户要总pv*45%的红包
848 848
             if($user["is_old"]==1){
849 849
                 //添加红包
850
-                $hongbao=roundOptimize($inc_score*0.45,2);
850
+                $hongbao=round_optimize($inc_score*0.45,2);
851 851
                 $hongbao_data = [
852 852
                     "uid"           =>$user_id,
853 853
                     "number"  =>    $hongbao,
@@ -875,7 +875,7 @@ class UserThirdRepository extends BaseRepository
875 875
         
876 876
                 // @todo 用户身份比例
877 877
                 $yongjinbili = StoreOrderRepository::getUserGroupRate($sprerdUser['user_group']);
878
-                $tuiguanyongjin=roundOptimize($yongjinbili*$inc_score,2);//按照身份获得佣金
878
+                $tuiguanyongjin=round_optimize($yongjinbili*$inc_score,2);//按照身份获得佣金
879 879
 
880 880
                 //添加推广积分
881 881
                 $tuijifendata = [
@@ -896,7 +896,7 @@ class UserThirdRepository extends BaseRepository
896 896
 
897 897
                 //添加推荐献值 普通用户 贡献值为 pv* 30%;推广人是业务员及以上身份,贡献值为:pv的1:1
898 898
                 if($sprerdUser['user_group'] <= 1){
899
-                    $gongxian = roundOptimize($gongxian*0.3,2);
899
+                    $gongxian = round_optimize($gongxian*0.3,2);
900 900
                 }
901 901
                 $tuigangongxian_data = [
902 902
                     "uid"           =>$sprerdUser['uid'],