|
|
@@ -133,7 +133,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
}
|
|
|
// 在支付前触发一个事件,允许其他功能模块对支付行为进行干预或附加操作
|
|
|
event('order.pay.before', compact('groupOrder', 'type', 'isApp'));
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗4\r\n",8);
|
|
|
|
|
|
// 根据支付方式和是否使用组合支付,选择不同的支付服务类
|
|
|
if (in_array($type, ['weixin', 'weixinApp', 'routine', 'h5', 'weixinQr'], true) && $combine) {
|
|
|
@@ -156,7 +155,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
}
|
|
|
}
|
|
|
// 返回支付配置和订单ID,支付配置中包含支付方式的状态信息
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗3\r\n",8);
|
|
|
|
|
|
return app('json')->status($type, $config + ['order_id' => $groupOrder['group_order_id'], 'pay_price' => $groupOrder['pay_price']]);
|
|
|
}
|
|
|
@@ -294,7 +292,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
$storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class);
|
|
|
$svipDiscount = 0;
|
|
|
$isPoints = false;
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗9\r\n",8);
|
|
|
|
|
|
foreach ($groupOrder->orderList as $_k => $order) {
|
|
|
$order->paid = 1;
|
|
|
@@ -393,7 +390,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
}
|
|
|
|
|
|
$_order_rate = 0;
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗8\r\n",8);
|
|
|
|
|
|
if ($order['commission_rate'] > 0) {
|
|
|
$commission_rate = bcdiv((string)$order['commission_rate'], '100', 6);
|
|
|
@@ -419,7 +415,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
];
|
|
|
}
|
|
|
if ($order['extension_two'] > 0) {
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗5\r\n",8);
|
|
|
$finance[] = [
|
|
|
'order_id' => $order->order_id,
|
|
|
'order_sn' => $order->order_sn,
|
|
|
@@ -507,12 +502,9 @@ class StoreOrderRepository extends BaseRepository
|
|
|
}
|
|
|
//自动打印订单
|
|
|
$this->autoPrinter($order->order_id, $order->mer_id, 1);
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗6\r\n",8);
|
|
|
app()->make(StoreOrderRepository::class)->getOrderAward($order);
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗13\r\n",8);
|
|
|
|
|
|
app()->make(StoreOrderRepository::class)->spreadOrder($order['uid'], $order['order_id']); //查找上级是否有冻结份额
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗10\r\n",8);
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -520,7 +512,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->user->spread_uid, 'type' => 'spread_pay_num', 'inc' => 1]);
|
|
|
Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->user->spread_uid, 'type' => 'spread_money', 'inc' => $groupOrder->pay_price]);
|
|
|
}
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗11\r\n",8);
|
|
|
|
|
|
app()->make(UserRepository::class)->update($groupOrder->uid, [
|
|
|
'pay_count' => Db::raw('pay_count+' . count($groupOrder->orderList)),
|
|
|
@@ -528,7 +519,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
'svip_save_money' => Db::raw('svip_save_money+' . $svipDiscount),
|
|
|
]);
|
|
|
$this->giveIntegral($groupOrder);
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗12\r\n",8);
|
|
|
|
|
|
if (count($profitsharing)) {
|
|
|
$storeOrderProfitsharingRepository->insertAll($profitsharing);
|
|
|
@@ -538,14 +528,12 @@ class StoreOrderRepository extends BaseRepository
|
|
|
if (count($groupOrder['give_coupon_ids']) > 0)
|
|
|
$groupOrder['give_coupon_ids'] = app()->make(StoreCouponRepository::class)->getGiveCoupon($groupOrder['give_coupon_ids'])->column('coupon_id');
|
|
|
$groupOrder->save();
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗14\r\n",8);
|
|
|
|
|
|
});
|
|
|
//满额分销
|
|
|
if ($groupOrder->user && !$groupOrder->user->is_promoter && systemConfig('promoter_type') == 3) {
|
|
|
app()->make(UserRepository::class)->meetWithPromoter($groupOrder->user->uid);
|
|
|
}
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗15\r\n",8);
|
|
|
|
|
|
if (count($groupOrder['give_coupon_ids']) > 0) {
|
|
|
try {
|
|
|
@@ -553,7 +541,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
} catch (Exception $e) {
|
|
|
}
|
|
|
}
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗7\r\n",8);
|
|
|
|
|
|
Queue::push(SendSmsJob::class, ['tempId' => 'ORDER_PAY_SUCCESS', 'id' => $groupOrder->group_order_id]);
|
|
|
Queue::push(SendSmsJob::class, ['tempId' => 'ADMIN_PAY_SUCCESS_CODE', 'id' => $groupOrder->group_order_id]);
|
|
|
@@ -1132,7 +1119,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
$type = 6;
|
|
|
}
|
|
|
$price = app()->make(AwardIntegralPriceRepository::class)->awardIntegralPrice(); //分红积分价格
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗15\r\n",8);
|
|
|
// 创建用户账单仓库实例
|
|
|
$make = app()->make(UserBillRepository::class);
|
|
|
$user = User::where('uid', $order['uid'])->find();
|
|
|
@@ -1271,14 +1257,11 @@ class StoreOrderRepository extends BaseRepository
|
|
|
// }
|
|
|
// }
|
|
|
//份额和积分变动时触发
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗16\r\n",8);
|
|
|
$UserRepository = app()->make(UserRepository::class);
|
|
|
$UserRepository->checkAward($order['uid']);
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗20\r\n",8);
|
|
|
|
|
|
// 上级推荐奖励的分红积分
|
|
|
$this->getSpreadIntegral($order, $type, $user, $product_id);
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗21\r\n",8);
|
|
|
|
|
|
// 检测节能油或者礼包升级
|
|
|
// $AwardLake = app()->make(AwardLake::class);
|
|
|
@@ -1286,7 +1269,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
if ($type == 5) {
|
|
|
$oil = app()->make(OilLevel::class);
|
|
|
$oil->checkLevel($order['uid']);
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗22\r\n",8);
|
|
|
|
|
|
// $ratio = systemConfig('energy_saving_oil_ratio', 10);
|
|
|
// @file_put_contents('quanju2.txt', $ratio . "-奖池比例12\r\n", 8);
|
|
|
@@ -1297,7 +1279,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
} elseif ($type == 6) {
|
|
|
$gift = app()->make(GiftLevel::class);
|
|
|
$gift->checkLevel($order['uid']);
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗23\r\n",8);
|
|
|
|
|
|
// $ratio = systemConfig('gift_pack_ratio', 10);
|
|
|
// @file_put_contents('quanju2.txt', $ratio . "-奖池比例\r\n", 8);
|
|
|
@@ -1310,12 +1291,10 @@ class StoreOrderRepository extends BaseRepository
|
|
|
$award_brokerage = systemConfig('award_brokerage', 15);
|
|
|
$award_brokerage = bcdiv($award_brokerage,100,2);
|
|
|
if ($award_brokerage>0){
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗24\r\n",8);
|
|
|
|
|
|
$brokerage_price = User::where('uid', $user['uid'])->value('brokerage_price');
|
|
|
$order_award_brokerage = bcmul($order['pay_price'], $award_brokerage, 2);
|
|
|
if ($order_award_brokerage > 0) {
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗25\r\n",8);
|
|
|
|
|
|
// $order_award_range = bcdiv($order_award_range, $price['price'], 2); //业绩除以积分价格得到分红积分
|
|
|
$after = bcadd($brokerage_price, $order_award_brokerage, 2);
|
|
|
@@ -1331,7 +1310,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
}
|
|
|
}
|
|
|
return true;
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗17\r\n",8);
|
|
|
} catch (\Exception $e) {
|
|
|
@file_put_contents('quanju4.txt', $e->getMessage() . "-支付报错内容\r\n", 8);
|
|
|
@file_put_contents('quanju4.txt', $e->getFile() . "-文件\r\n", 8);
|
|
|
@@ -1503,7 +1481,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
@file_put_contents('quanju2.txt', $order_id . "-没有冻结份额订单id\r\n", 8);
|
|
|
$spread_uid = User::where('uid', $uid)->value('spread_uid');
|
|
|
@file_put_contents('quanju2.txt', $spread_uid . "-上级uid\r\n", 8);
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗17\r\n",8);
|
|
|
|
|
|
if ($spread_uid > 0) {
|
|
|
$user = User::where('uid', $spread_uid)->find();
|
|
|
@@ -1534,7 +1511,6 @@ class StoreOrderRepository extends BaseRepository
|
|
|
$UserRepository->extractBrokerage($spread_uid);
|
|
|
}
|
|
|
}
|
|
|
- @file_put_contents('quanju4.txt',"-支付能传到这里吗18\r\n",8);
|
|
|
|
|
|
return true;
|
|
|
}
|