ソースを参照

跨店收益比例调整

xialei 1 年間 前
コミット
a690f26477
共有2 個のファイルを変更した8 個の追加8 個の削除を含む
  1. 3 3
      app/common/repositories/merchant/order/OrderMerchantRepository.php
  2. 5 5
      app/controller/api/user/User.php

+ 3 - 3
app/common/repositories/merchant/order/OrderMerchantRepository.php

@@ -1336,7 +1336,7 @@ class OrderMerchantRepository extends BaseRepository
1336
 
1336
 
1337
         // 用户可以拿到的红包 红包:如果是1.0的老用户 pv的45%放到红包里面。14*45%=6.3元。直至金额满足1.0平台当前用户身份为止就不在反红包了
1337
         // 用户可以拿到的红包 红包:如果是1.0的老用户 pv的45%放到红包里面。14*45%=6.3元。直至金额满足1.0平台当前用户身份为止就不在反红包了
1338
         $old_vip_limit = Db::name('user_sign_hongbao')->where('uid',$order["uid"])->sum('number') ?? 0;
1338
         $old_vip_limit = Db::name('user_sign_hongbao')->where('uid',$order["uid"])->sum('number') ?? 0;
1339
-        if($user['is_old']==1 && $old_vip_limit < $user['old_vip_limit']){
1339
+        if($user['is_old']==1){
1340
             //添加红包
1340
             //添加红包
1341
             $hongbao=bcmul($pv, $yonghu_hongbao, 2);
1341
             $hongbao=bcmul($pv, $yonghu_hongbao, 2);
1342
             $hongbao_data = [
1342
             $hongbao_data = [
@@ -1490,7 +1490,7 @@ class OrderMerchantRepository extends BaseRepository
1490
         //  商家京豆比例
1490
         //  商家京豆比例
1491
         $mer_jd = $getMerchantContribution['jd'];
1491
         $mer_jd = $getMerchantContribution['jd'];
1492
         //跨店分佣
1492
         //跨店分佣
1493
-        $kd = 0.1;
1493
+        $kd = 0.05;
1494
         /**
1494
         /**
1495
          * 各自的比例结束
1495
          * 各自的比例结束
1496
          */
1496
          */
@@ -1551,7 +1551,7 @@ class OrderMerchantRepository extends BaseRepository
1551
         Db::name('log')->insert(['data' => 'PV:' . $pv .' mer_jd:'. $mer_jd.' mer_gonxian:'.$mer_gonxian.' jingdou:'.$merchant_user->jingdou.' contribute:'.$merchant_user->contribute]);
1551
         Db::name('log')->insert(['data' => 'PV:' . $pv .' mer_jd:'. $mer_jd.' mer_gonxian:'.$mer_gonxian.' jingdou:'.$merchant_user->jingdou.' contribute:'.$merchant_user->contribute]);
1552
 
1552
 
1553
         //跨店
1553
         //跨店
1554
-        $kd_yongjin = bcmul($divisible_commission, $kd, 2);
1554
+        $kd_yongjin = bcmul($pv, $kd, 2);
1555
         if ($kd_yongjin >= 0.01) {
1555
         if ($kd_yongjin >= 0.01) {
1556
             $mer_uid = Db::name("merchant")->where("mer_id",$top_data["mer_id"])->find();
1556
             $mer_uid = Db::name("merchant")->where("mer_id",$top_data["mer_id"])->find();
1557
             if ($mer_uid){
1557
             if ($mer_uid){

+ 5 - 5
app/controller/api/user/User.php

@@ -1998,7 +1998,7 @@ return app("json")->success($data);
1998
         $data['yanglao_yugu_all'] = $data['yanglao_clear_all'] + $data['yanglao_nclear_all'];
1998
         $data['yanglao_yugu_all'] = $data['yanglao_clear_all'] + $data['yanglao_nclear_all'];
1999
         $where['uid'] = $uid;
1999
         $where['uid'] = $uid;
2000
         $data['totel_money'] = Db::name('user_bill')->where($where)
2000
         $data['totel_money'] = Db::name('user_bill')->where($where)
2001
-            ->whereNotIn('commission_type', [5, 7, 17, 19])
2001
+            ->whereNotIn('commission_type', [0, 5, 17, 19])
2002
             ->when($commission_type == 5, function ($query) use ($where, $startMonth, $endMonth) {
2002
             ->when($commission_type == 5, function ($query) use ($where, $startMonth, $endMonth) {
2003
                 $query->whereBetween('create_time', [$startMonth, $endMonth]);
2003
                 $query->whereBetween('create_time', [$startMonth, $endMonth]);
2004
             }, function ($query) use ($where, $month, $startMonth, $endMonth) {
2004
             }, function ($query) use ($where, $month, $startMonth, $endMonth) {
@@ -2009,7 +2009,7 @@ return app("json")->success($data);
2009
 
2009
 
2010
         $pageInfo = Db::name('user_bill')
2010
         $pageInfo = Db::name('user_bill')
2011
             ->where($where)
2011
             ->where($where)
2012
-            ->whereNotIn('commission_type', [5, 7, 17, 19])
2012
+            ->whereNotIn('commission_type', [0, 5, 17, 19])
2013
             ->when($commission_type == 5, function ($query) use ($where, $startMonth, $endMonth) {
2013
             ->when($commission_type == 5, function ($query) use ($where, $startMonth, $endMonth) {
2014
                 $query->whereBetween('create_time', [$startMonth, $endMonth]);
2014
                 $query->whereBetween('create_time', [$startMonth, $endMonth]);
2015
             }, function ($query) use ($where, $month, $startMonth, $endMonth) {
2015
             }, function ($query) use ($where, $month, $startMonth, $endMonth) {
@@ -3217,15 +3217,15 @@ return app("json")->success($data);
3217
         $data['sum_amount'] = Db::name('user_bill')
3217
         $data['sum_amount'] = Db::name('user_bill')
3218
             ->where('uid', $uid)
3218
             ->where('uid', $uid)
3219
             ->where('commission_type', '<>', 5)
3219
             ->where('commission_type', '<>', 5)
3220
+            ->where('commission_type', '<>', 0)
3220
             ->where('pm', 1)
3221
             ->where('pm', 1)
3221
             ->sum('number');
3222
             ->sum('number');
3222
 
3223
 
3223
-
3224
-
3225
         //未结算
3224
         //未结算
3226
         $data['no_clear_amount'] = Db::name('user_bill')
3225
         $data['no_clear_amount'] = Db::name('user_bill')
3227
             ->where('uid', $uid)
3226
             ->where('uid', $uid)
3228
             ->where('commission_type', '<>', 5)
3227
             ->where('commission_type', '<>', 5)
3228
+            ->where('commission_type', '<>', 0)
3229
             ->where('pm', 1)
3229
             ->where('pm', 1)
3230
             ->where('status', 0)
3230
             ->where('status', 0)
3231
             ->sum('number');
3231
             ->sum('number');
@@ -3243,7 +3243,7 @@ return app("json")->success($data);
3243
         //最终 总收益是 = 佣金余额 + 已提现 + 已转VR
3243
         //最终 总收益是 = 佣金余额 + 已提现 + 已转VR
3244
         $data['sum_amount'] = $data['sum_amount'] + $data['transition_vr_amount'];
3244
         $data['sum_amount'] = $data['sum_amount'] + $data['transition_vr_amount'];
3245
 
3245
 
3246
-
3246
+        $data['sum_amount'] = set_price_rtrim($data['sum_amount']);
3247
         return app('json')->success($data);
3247
         return app('json')->success($data);
3248
     }
3248
     }
3249
 
3249