浏览代码

跨店收益比例调整

xialei 1 年之前
父节点
当前提交
a690f26477

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

@@ -1336,7 +1336,7 @@ class OrderMerchantRepository extends BaseRepository
1336 1336
 
1337 1337
         // 用户可以拿到的红包 红包:如果是1.0的老用户 pv的45%放到红包里面。14*45%=6.3元。直至金额满足1.0平台当前用户身份为止就不在反红包了
1338 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 1341
             $hongbao=bcmul($pv, $yonghu_hongbao, 2);
1342 1342
             $hongbao_data = [
@@ -1490,7 +1490,7 @@ class OrderMerchantRepository extends BaseRepository
1490 1490
         //  商家京豆比例
1491 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 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 1555
         if ($kd_yongjin >= 0.01) {
1556 1556
             $mer_uid = Db::name("merchant")->where("mer_id",$top_data["mer_id"])->find();
1557 1557
             if ($mer_uid){

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

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