hefei 1 yıl önce
ebeveyn
işleme
369a88ae8b

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

@@ -1575,7 +1575,7 @@ class StoreOrderRepository extends BaseRepository
1575 1575
                             }
1576 1576
                         }
1577 1577
                         $order['product_id'] = $v['product_id'];
1578
-                        $this->gongFuDistribution($order, $order['product_id'], $v['product_attr_unique'], 0, $productType);
1578
+//                        $this->gongFuDistribution($order, $order['product_id'], $v['product_attr_unique'], 0, $productType);
1579 1579
 
1580 1580
                         if ($order['product_id'] == 15323) {
1581 1581
                             Db::name('activation_code')
@@ -9473,7 +9473,7 @@ class StoreOrderRepository extends BaseRepository
9473 9473
                 }
9474 9474
 
9475 9475
             }
9476
-
9476
+            $ds = 1;
9477 9477
         }
9478 9478
 
9479 9479
 
@@ -9481,7 +9481,7 @@ class StoreOrderRepository extends BaseRepository
9481 9481
 
9482 9482
         if ($comm_order_type == 3) {
9483 9483
             $name = '直推奖';
9484
-            $ds = 1;
9484
+
9485 9485
         } else if ($comm_order_type == 5) {
9486 9486
             $name = '养老金';
9487 9487
             //$user_bill_status = Db::name('store_order')->where("order_id",$order_id)->update(['gzc'=>1]);

+ 166 - 141
app/controller/api/Notify.php

@@ -4,6 +4,7 @@ namespace app\controller\api;
4 4
 use AdaPaySdk\AdapayTools;
5 5
 use app\common\repositories\merchant\order\OrderMerchantRepository;
6 6
 use app\common\repositories\movie\MovieRepository;
7
+use app\common\repositories\store\order\StoreOrderRepository;
7 8
 use app\common\repositories\store\order\StoreRefundOrderRepository;
8 9
 use app\common\repositories\system\merchant\MerchantRepository;
9 10
 use app\common\repositories\user\UserRepository;
@@ -190,152 +191,177 @@ class Notify
190 191
                                     //给推广者分配养老金
191 192
                                     //给推广者分配佣金
192 193
                                     // if ($user_data['spread_uid'] != 0) {
193
-                                    if ($user_data['uid'] > 611) {
194 194
                                         //查询下单用户上级身份
195 195
                                         $spread_data = Db::name('user')->where('uid',$user_data['spread_uid'])->find();
196
+                                        $StoreOrderRepository = app()->make(StoreOrderRepository::class);
197
+                                        $rate = $StoreOrderRepository->getUserGroupRate($spread_data['user_group']);
198
+                                    if ($spread_data['user_group'] == 1) {
199
+                                        $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
200
+                                        $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
201
+
202
+                                        $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
196 203
 
204
+                                        //推广养老金
205
+                                        //推广佣金
206
+                                        $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 5, $store_order_data['order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id'], 0);
207
+                                        // 贡献值
208
+                                        $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 11, "推广精彩生活商品赠送贡献值");
209
+                                        //积分
210
+                                        $this->score_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 11, "推广精彩生活商品赠送积分");
211
+                                    } else if ($spread_data['user_group'] > 1) {
212
+
213
+                                        $ssf = bcmul($pv, $rate, 2);
214
+                                        $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
215
+                                        $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
216
+                                        $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
217
+
218
+                                        //贡献值
219
+                                        $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 11, "推广精彩生活区商品赠送贡献值");
220
+                                        //积分
221
+                                        $this->score_log($spread_data['uid'], $ssf, $store_order_data['order_id'], 11, "推广精彩生活区商品赠送积分");
222
+                                        // //推广佣金
223
+                                        $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 5, $store_order_data['order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id'], 0);
224
+                                        //养老金
225
+                                        $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.05, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '推广获得养老金' . bcmul($pv, 0.05, 2), $store_order_data['mer_id'], 0);
226
+                                    }
197 227
                                         //业务员或以上的推荐人等级
198 228
                                         //user_group=1是消费者 3%,2:业务员 5%,3:业务经理7%,4:初级合伙人9%,5:中级合伙人11%,6:高级合伙人13%,7:董事15%
199
-                                        if($spread_data['user_group'] > 1){
200
-
201
-                                            // //给推广者分配佣金
202
-                                            $yj_amount = 0;
203
-                                            $ylj_amount = $spread_data['annuity'] + bcmul($pv, 0.05,2);
204
-                                            $ssf = 0;//变量
205
-                                            $yj_amount_90 = 0;//90%的佣金
206
-
207
-                                            if($spread_data['user_group'] == 2){
208
-                                                $ssf =bcmul($pv, 0.07,2);
209
-                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.07,2);
210
-                                                $score     = $spread_data['score'] + bcmul($pv, 0.07,2);
211
-
212
-
213
-                                                $yj_amount_90 = bcmul($pv, 0.07,2) * 0.9;
214
-                                                $fgj_amount_10 = bcmul($pv, 0.07,2) * 0.1;//推广者的佣金抽10%到个人复购金
215
-
216
-                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
217
-                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
218
-                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
219
-
220
-
221
-
222
-                                                // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
223
-                                            }else if($spread_data['user_group'] == 3){
224
-                                                $ssf =bcmul($pv, 0.09,2);
225
-                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.09,2);
226
-                                                $score     = $spread_data['score'] + bcmul($pv, 0.09,2);
227
-
228
-                                                $yj_amount_90 = bcmul($pv, 0.09,2) * 0.9;
229
-                                                $fgj_amount_10 = bcmul($pv, 0.09,2) * 0.1;//推广者的佣金抽10%到个人复购金
230
-
231
-                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
232
-                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
233
-                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
234
-
235
-                                                // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
236
-                                            }else if($spread_data['user_group'] == 4){
237
-                                                $ssf =bcmul($pv, 0.11,2);
238
-                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.11,2);
239
-                                                $score     = $spread_data['score'] + bcmul($pv, 0.11,2);
240
-
241
-
242
-                                                $yj_amount_90 = bcmul($pv, 0.11,2) * 0.9;
243
-                                                $fgj_amount_10 = bcmul($pv, 0.11,2) * 0.1;//推广者的佣金抽10%到个人复购金
244
-
245
-                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
246
-                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
247
-                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
248
-
249
-                                                //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
250
-                                            }else if($spread_data['user_group'] == 5){
251
-                                                $ssf =bcmul($pv, 0.13,2);
252
-                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.13,2);
253
-                                                $score     = $spread_data['score'] + bcmul($pv, 0.13,2);
254
-                                                // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.13,2);
255
-
256
-                                                $yj_amount_90 = bcmul($pv, 0.13,2) * 0.9;
257
-                                                $fgj_amount_10 = bcmul($pv, 0.13,2) * 0.1;//推广者的佣金抽10%到个人复购金
258
-
259
-                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
260
-                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
261
-                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
262
-
263
-                                                // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
264
-                                            }else if($spread_data['user_group'] == 6){
265
-                                                $ssf =bcmul($pv, 0.15,2);
266
-                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.15,2);
267
-                                                $score     = $spread_data['score'] + bcmul($pv, 0.15,2);
268
-                                                // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.15,2);
269
-
270
-                                                $yj_amount_90 = bcmul($pv, 0.15,2) * 0.9;
271
-                                                $fgj_amount_10 = bcmul($pv, 0.15,2) * 0.1;//推广者的佣金抽10%到个人复购金
272
-
273
-                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
274
-                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
275
-                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
276
-
277
-                                                // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
278
-                                            }else if($spread_data['user_group'] == 7){
279
-                                                $ssf =bcmul($pv, 0.17,2);
280
-                                                $con       = $spread_data['contribute'] + bcmul($pv * 0.17,2);
281
-                                                $score     = $spread_data['score'] + bcmul($pv, 0.17,2);
282
-                                                // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.17,2);
283
-
284
-                                                $yj_amount_90 = bcmul($pv, 0.17,2) * 0.9;
285
-                                                $fgj_amount_10 = bcmul($pv, 0.17,2) * 0.1;//推广者的佣金抽10%到个人复购金
286
-
287
-                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
288
-                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
289
-                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
290
-
291
-                                                // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
292
-                                            }
293
-
294
-                                            //贡献值
295
-                                            $this->con_log($spread_data['uid'],$pv,$store_order_data['order_id'],11,"精彩生活区商品赠送贡献值");
296
-                                            //积分
297
-                                            $this->score_log($spread_data['uid'],$ssf,$store_order_data['order_id'],11,"精彩生活区商品赠送积分");
298
-                                            // //推广佣金
299
-                                            $this->bill_user_log($spread_data['uid'],$yj_amount_90,$store_order_data['order_id'],3,$store_order_data['order_sn'],'推广获得佣金'.$yj_amount_90,$store_order_data['mer_id'],0);
300
-                                            //养老金
301
-                                            $this->bill_user_log($spread_data['uid'],round($pv * 0.05,2),$store_order_data['order_id'],5,$store_order_data['order_sn'],'推广获得养老金'.round($pv * 0.05,2),$store_order_data['mer_id'],0);
302
-                                        }
229
+//                                        if($spread_data['user_group'] > 1){
230
+//
231
+//                                            // //给推广者分配佣金
232
+//                                            $yj_amount = 0;
233
+//                                            $ylj_amount = $spread_data['annuity'] + bcmul($pv, $rate,2);
234
+//                                            $ssf = 0;//变量
235
+//                                            $yj_amount_90 = 0;//90%的佣金
236
+//
237
+//                                            if($spread_data['user_group'] == 2){
238
+//                                                $ssf =bcmul($pv, $rate,2);
239
+//                                                $con       = $spread_data['contribute'] + bcmul($pv, $rate,2);
240
+//                                                $score     = $spread_data['score'] + bcmul($pv, $rate,2);
241
+//
242
+//
243
+//                                                $yj_amount_90 = bcmul($pv, $rate,2) * 0.9;
244
+//                                                $fgj_amount_10 = bcmul($pv, $rate,2) * 0.1;//推广者的佣金抽10%到个人复购金
245
+//
246
+//                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
247
+//                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
248
+//                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
249
+//
250
+//
251
+//
252
+//                                                // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
253
+//                                            }else if($spread_data['user_group'] == 3){
254
+//                                                $ssf =bcmul($pv, 0.09,2);
255
+//                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.09,2);
256
+//                                                $score     = $spread_data['score'] + bcmul($pv, 0.09,2);
257
+//
258
+//                                                $yj_amount_90 = bcmul($pv, 0.09,2) * 0.9;
259
+//                                                $fgj_amount_10 = bcmul($pv, 0.09,2) * 0.1;//推广者的佣金抽10%到个人复购金
260
+//
261
+//                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
262
+//                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
263
+//                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
264
+//
265
+//                                                // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
266
+//                                            }else if($spread_data['user_group'] == 4){
267
+//                                                $ssf =bcmul($pv, 0.11,2);
268
+//                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.11,2);
269
+//                                                $score     = $spread_data['score'] + bcmul($pv, 0.11,2);
270
+//
271
+//
272
+//                                                $yj_amount_90 = bcmul($pv, 0.11,2) * 0.9;
273
+//                                                $fgj_amount_10 = bcmul($pv, 0.11,2) * 0.1;//推广者的佣金抽10%到个人复购金
274
+//
275
+//                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
276
+//                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
277
+//                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
278
+//
279
+//                                                //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
280
+//                                            }else if($spread_data['user_group'] == 5){
281
+//                                                $ssf =bcmul($pv, 0.13,2);
282
+//                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.13,2);
283
+//                                                $score     = $spread_data['score'] + bcmul($pv, 0.13,2);
284
+//                                                // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.13,2);
285
+//
286
+//                                                $yj_amount_90 = bcmul($pv, 0.13,2) * 0.9;
287
+//                                                $fgj_amount_10 = bcmul($pv, 0.13,2) * 0.1;//推广者的佣金抽10%到个人复购金
288
+//
289
+//                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
290
+//                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
291
+//                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
292
+//
293
+//                                                // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
294
+//                                            }else if($spread_data['user_group'] == 6){
295
+//                                                $ssf =bcmul($pv, 0.15,2);
296
+//                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.15,2);
297
+//                                                $score     = $spread_data['score'] + bcmul($pv, 0.15,2);
298
+//                                                // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.15,2);
299
+//
300
+//                                                $yj_amount_90 = bcmul($pv, 0.15,2) * 0.9;
301
+//                                                $fgj_amount_10 = bcmul($pv, 0.15,2) * 0.1;//推广者的佣金抽10%到个人复购金
302
+//
303
+//                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
304
+//                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
305
+//                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
306
+//
307
+//                                                // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
308
+//                                            }else if($spread_data['user_group'] == 7){
309
+//                                                $ssf =bcmul($pv, 0.17,2);
310
+//                                                $con       = $spread_data['contribute'] + bcmul($pv * 0.17,2);
311
+//                                                $score     = $spread_data['score'] + bcmul($pv, 0.17,2);
312
+//                                                // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.17,2);
313
+//
314
+//                                                $yj_amount_90 = bcmul($pv, 0.17,2) * 0.9;
315
+//                                                $fgj_amount_10 = bcmul($pv, 0.17,2) * 0.1;//推广者的佣金抽10%到个人复购金
316
+//
317
+//                                                $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
318
+//                                                $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
319
+//                                                $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
320
+//
321
+//                                                // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
322
+//                                            }
323
+//
324
+//                                            //贡献值
325
+//                                            $this->con_log($spread_data['uid'],$pv,$store_order_data['order_id'],11,"精彩生活区商品赠送贡献值");
326
+//                                            //积分
327
+//                                            $this->score_log($spread_data['uid'],$ssf,$store_order_data['order_id'],11,"精彩生活区商品赠送积分");
328
+//                                            // //推广佣金
329
+//                                            $this->bill_user_log($spread_data['uid'],$yj_amount_90,$store_order_data['order_id'],3,$store_order_data['order_sn'],'推广获得佣金'.$yj_amount_90,$store_order_data['mer_id'],0);
330
+//                                            //养老金
331
+//                                            $this->bill_user_log($spread_data['uid'],round($pv * 0.05,2),$store_order_data['order_id'],5,$store_order_data['order_sn'],'推广获得养老金'.round($pv * 0.05,2),$store_order_data['mer_id'],0);
332
+//                                        }
303 333
 
304 334
                                         //普通用户推广人
305
-                                        if($spread_data['user_group'] == 1){
306
-                                            //给推广者分配佣金
307
-                                            // $ylj_amount = $spread_data['annuity'] + round($pv * 0.3,2);
308
-                                            // $yj_amount_90 = round($pv * 0.21,2) * 0.9;
309
-                                            $yj_amount_90 = bcmul($pv, 0.3,2) * 0.9;
310
-                                            // $fgj_amount_10 = round($pv * 0.21,2) * 0.1;//推广者的佣金抽10%到个人复购金
311
-                                            $fgj_amount_10 = bcmul($pv, 0.3,2) * 0.1;//推广者的佣金抽10%到个人复购金
312
-
313
-                                            $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
314
-                                            $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
315
-                                            $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
316
-
317
-                                            //Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
318
-
319
-                                            $con = $spread_data['contribute'] + bcmul($pv, 0.3,2);
320
-                                            $score = $spread_data['score'] + bcmul($pv, 0.3,2);
321
-
322
-                                            //贡献值和积分
323
-                                            //Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
324
-
325
-                                            //推广养老金
326
-
327
-                                            //推广佣金
328
-                                            $this->bill_user_log($spread_data['uid'],$yj_amount_90,$store_order_data['order_id'],3,$store_order_data['order_sn'],'推广获得佣金'.$yj_amount_90,$store_order_data['mer_id'],0);
329
-                                            $this->con_log($spread_data['uid'],round($pv * 0.3,2),$store_order_data['order_id'],11,"推广精彩生活区商品赠送贡献值");
330
-                                            $this->score_log($spread_data['uid'],round($pv * 0.3,2),$store_order_data['order_id'],11,"推广精彩生活区商品赠送积分");
331
-
332
-
333
-
334
-                                        }
335
-
336
-
337
-
338
-                                    }
335
+//                                        if($spread_data['user_group'] == 1){
336
+//                                            //给推广者分配佣金
337
+//                                            // $ylj_amount = $spread_data['annuity'] + round($pv * 0.3,2);
338
+//                                            // $yj_amount_90 = round($pv * 0.21,2) * 0.9;
339
+//                                            $yj_amount_90 = bcmul($pv, 0.3,2) * 0.9;
340
+//                                            // $fgj_amount_10 = round($pv * 0.21,2) * 0.1;//推广者的佣金抽10%到个人复购金
341
+//                                            $fgj_amount_10 = bcmul($pv, 0.3,2) * 0.1;//推广者的佣金抽10%到个人复购金
342
+//
343
+//                                            $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
344
+//                                            $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
345
+//                                            $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
346
+//
347
+//                                            //Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
348
+//
349
+//                                            $con = $spread_data['contribute'] + bcmul($pv, 0.3,2);
350
+//                                            $score = $spread_data['score'] + bcmul($pv, 0.3,2);
351
+//
352
+//                                            //贡献值和积分
353
+//                                            //Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
354
+//
355
+//                                            //推广养老金
356
+//
357
+//                                            //推广佣金
358
+//                                            $this->bill_user_log($spread_data['uid'],$yj_amount_90,$store_order_data['order_id'],3,$store_order_data['order_sn'],'推广获得佣金'.$yj_amount_90,$store_order_data['mer_id'],0);
359
+//                                            $this->con_log($spread_data['uid'],round($pv * 0.3,2),$store_order_data['order_id'],11,"推广精彩生活区商品赠送贡献值");
360
+//                                            $this->score_log($spread_data['uid'],round($pv * 0.3,2),$store_order_data['order_id'],11,"推广精彩生活区商品赠送积分");
361
+//
362
+//
363
+//
364
+//                                        }
339 365
 
340 366
                                     //锁客收益
341 367
                                     if($user_data['mer_id'] != 0){
@@ -1753,8 +1779,7 @@ class Notify
1753 1779
                     Db::name('gzc_logs')->insert($ylj_data_log);
1754 1780
 
1755 1781
                 }
1756
-
1757
-                
1782
+                $ds = 1;
1758 1783
             }
1759 1784
            
1760 1785
         }

+ 11 - 11
app/controller/api/store/order/StoreOrder.php

@@ -1897,17 +1897,17 @@ class StoreOrder extends BaseController
1897 1897
 //
1898 1898
 //            return app('json')->status('success', '支付成功', ['order_id' => $groupOrder['group_order_id']]);
1899 1899
 //        }
1900
-        if ($groupOrder['pay_price'] == 0) {
1901
-            $this->repository->paySuccess($groupOrder);
1902
-            return app('json')->status('success', '支付成功2', ['order_id' => $groupOrder['group_order_id']]);
1903
-        }
1904
-        try {
1905
-            $groupOrder['pay_price'] =set_price_rtrim($groupOrder['pay_price'] );
1906
-            return app('json')->success(['order_id' => $groupOrder->group_order_id,"groupOrder"=>$groupOrder]);
1907
-//            return $this->repository->pay($payType, $this->request->userInfo(), $groupOrder);
1908
-        } catch (\Exception $e) {
1909
-            return app('json')->status('error', $e->getMessage(), ['order_id' => $groupOrder->group_order_id]);
1910
-        }
1900
+//        if ($groupOrder['pay_price'] == 0) {
1901
+//            $this->repository->paySuccess($groupOrder);
1902
+//            return app('json')->status('success', '支付成功2', ['order_id' => $groupOrder['group_order_id']]);
1903
+//        }
1904
+//        try {
1905
+//            $groupOrder['pay_price'] =set_price_rtrim($groupOrder['pay_price'] );
1906
+//            return app('json')->success(['order_id' => $groupOrder->group_order_id,"groupOrder"=>$groupOrder]);
1907
+////            return $this->repository->pay($payType, $this->request->userInfo(), $groupOrder);
1908
+//        } catch (\Exception $e) {
1909
+//            return app('json')->status('error', $e->getMessage(), ['order_id' => $groupOrder->group_order_id]);
1910
+//        }
1911 1911
     }
1912 1912
 
1913 1913